Hi,

Is it possible to extend the Paragraph API to allow users to define some empty spacing before and after a paragraph. I know this can be done by adding an empty paragraph with some leading before and after the normal paragraph, but it's not always that easy. For instance, I have a method addParagraph like this:

public void addParagraph(Document doc, String text) {
   Paragraph p = new Paragraph(text);
   doc.add(p);
}

If I now add an empty paragraph everytime I add a normal paragraph, I could by accident let the next page start with an empty line if the empty paragraph doesn't fit on the current page anymore. Or even worse, I could by accident add an empty page to the document if the normal paragraph was the last paragraph of the document and was placed at the bottom of the last page. Also simulating spacing before a paragraph begins by adding empty paragraphs can give similar problems: I don't want a page to start with an empty line, so if the page starts with a paragraph, the 'before spacing' of that paragraph should be ignored.

I think I can solve this myself if I could access the currentHeight property of the PdfDocument class and use it to check if adding spacing before/after a paragraph is appropriate. Unfortunately, the currentHeight property is private and there is no way to retrieve it. Are there other alternatives to to solve my problem ?

I've seen some similar requests here on the mailinglist, so maybe it would be nice if such methods could be added to the Paragraph API ?? Should I post a feature request at sourceforge, or doesn't it has a chance to get accepted?

thanks,
Maarten Coene



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to