> a) There is a 'non breaking space' character you could use. > I think it's (char)160, but you should check this in a ASCII table.
Yes, it's \u00a0, but the result is the same as with \u0020. I use
ct.setFollowingIndent() for text while the background image is aligned with
the left border of the column (see example_without_extra_space.gif). I have
tried to move the text 40px right at 300dpi using
Chunk myChunk = new Chunk("\u00a0", myFont);
myChunk.setHorizontalScaling(9.6f/myChunk.getWidthPoint()); // 40/300*72
myParagraph.add(myChunk);
But if I want a result as shown in example_with_extra_space.gif, I have to use
7.56f instead of 9.6f. Is there a solution to get an exact amount of extra
space without trying?
> b) I'm not sure what you want to achieve.
I want to generate something like example_multiline.gif as part of a
paragraph. My approach is to use a chunk of text with a background image for
every line. Inserting of extra space beetween these line should not affect
other lines of the paragraph.
Thanks a lot for your help !
Andreas
> >I sometimes need to insert extra space a) in a single line of text or
b)
> >between two lines of a paragraph.
> >
> >In case of a single line, a possible solution is to enter a chunk
containing
> a
> >space character and use setHorizontalScaling() to get the number of
points I
> >need. A way to get extra space between two lines of a paragraph is to
insert
> a
> >"\n" with a suitable font size.
> >
> >Are there better ways to achieve extra space ?
> >
> a) There is a 'non breaking space' character you could use.
> I think it's (char)160, but you should check this in a ASCII table.
>
> b) I'm not sure what you want to achieve. There are methods such as
> setLeading()
> that change the space between two lines and methods to add extra space
> before
> or after a Paragraph.
> http://itext.sourceforge.net/tutorial/objects/#paragraph
> Maybe you could define a static final Paragraph with a leading that
> corresponds
> with the space you need and add this Paragraph each time you need extra
> space.
>
> >Is there a problem with the listserver ?
> >
> I have the same problem as you from time to time.
> Sometime I see Paulo answering questions that never reached my mailbox.
> I don't know what's causing it. I think it's an overload problem at
> SourceForge.
> You also must know that a lot of SPAM and virusses are sent to the
> mailing-list.
> Paulo and I remove them manually. Sometimes the mailinglist problems concur
> with SPAM-attack periods...
> br,
> Bruno
<<attachment: example_without_extra_space.gif>>
<<attachment: example_with_extra_space.gif>>
<<attachment: example_multiline.gif>>
