Excellent. That's what I needed to know. Thanks for the help. I'll adapt my example and repost so others can benefit.
Thanks again, Jason -----Original Message----- From: 1T3XT BVBA [mailto:i...@1t3xt.info] Sent: Thursday, July 28, 2011 9:58 AM To: Post all your questions about iText here Subject: Re: [iText-questions] Document getBottomMargin() bug On 28/07/2011 15:42, Jason Berk wrote: > Is the rule "once you change margins, top/bottom/left/right may not > return what you expect"? The rule is: - don't change margins in PdfDocument (in a page event), change them in Document (not in a page event). - if you change them in Document, do so before triggering the newPage() method. - the new margins will only be "active" on the next page. I don't have the time to adapt, compile and execute your example, but this should be avoided: public void onEndPage(PdfWriter writer, Document document) { doc.setMargins(LEFT, RIGHT, TOP, BIG_BOTTOM); } I see that you tried to work around the fact that document is actually a PdfDocument instance. This is inventive (it surprised me), but I don't think it's a good idea. Operations on the Document object trigger page events, and you're triggering operations on the Document inside page events. I wouldn't bet on the outcome of such a workaround. ------------------------------------------------------------------------ ------ Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php This is a transmission from Purdue Federal Credit Union (Purdue Federal) and is intended solely for its authorized recipient(s), and may contain information that is confidential and or legally privileged. If you are not an addressee, or the employee or agent responsible for delivering it to an addressee, you are hereby notified that any use, dissemination, distribution, publication or copying of the information contained in this email is strictly prohibited. If you have received this transmission in error, please notify us by telephoning (765)497-3328 or returning the email. You are then instructed to delete the information from your computer. Thank you for your cooperation. ------------------------------------------------------------------------------ Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions iText(R) is a registered trademark of 1T3XT BVBA. Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php