I've some changes to the Paragraph and PdfDocument code in it seems to work. Is there a set of JUnit tests I can execute to verify everything is still ok?

In the meantime, I have created a new RFE and I have uploaded the changed files over there. You can find them at
http://sourceforge.net/tracker/index.php?func=detail&aid=913453&group_id=15255&atid=365255


thanks,
Maarten

Paulo Soares wrote:

If only thing were that easy... Currently the paragraph processing is a
can of worms, change something here and something else will break. If
you do the code changes we'll consider it's inclusion.

Best Regards,
Paulo Soares

-----Original Message-----
From: itext-questions-admin <at> lists.sourceforge.net [mailto:itext-questions-admin <at> lists.sourceforge.net] On Behalf Of Maarten Coene
Sent: Tuesday, March 09, 2004 12:53 PM
To: itext-questions <at> lists.sourceforge.net
Subject: [iText-questions] spacing between paragraphs


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