Leonardo Rosenthol wrote: >PDF pages have no such concept as a margin. I did a little reading after Carstens pointer to the AdobePress article on Itext. Good articles by the way. According to the 'Class Tour' section of that article, PDF pages do have a concept of a margin. Which sage is right? I don't know. Does this only apply to creating, not reading, a PDF?
I reproduced the relevant portions of the authors article: Document The com.lowagie.text.Document class describes a generic document: a container for various kinds of content and attributes (such as margins). The document is generic because its content is independent of any syntax (such as PDF syntax or RTF syntax). Document provides three constructors for creating Document objects. The no-argument constructor, which is used in Listing 1, creates a Document with A4 as the default page size (iText is a European library, and A4 is the most common page size in Europe) and 36 as the default size of each margin (measured in points, where there are 72 points per inch). If you prefer a different page size or different margins, simply call a different constructor, which the code fragment below demonstrates: Document document = new Document (PageSize.LETTER, 40, 40, 40, 40);The code fragment creates a Document with 8-1/2-inch by 11-inch pages and 40-point margins. Check out the com.lowagie.text.PageSize class for a complete list of page-size constants. Most of PageSize's constants represent portrait orientation. To achieve landscape orientation, all you need to do is make the page size's height smaller than its width. Because PageSize constants are instances of the com.lowagie.text.Rectangle class, you can easily obtain landscape orientation by invoking Rectangle's public Rectangle rotate() method, as follows: Document document = new Document (PageSize.LETTER.rotate ());If you ever need to determine the sizes of a document's margins, you can obtain that information by calling the following methods (each method returns a margin's size in point units): public float bottomMargin() public float leftMargin() public float rightMargin() public float topMargin() Every document has a (0,0) origin located in the lower-left corner. The locations of the document's margins are relative to this origin. Should you ever need to know where the margins are located, you can obtain that information by calling the methods below (as with the previous methods, each method's return value is in point units): public float bottom() public float left() public float right() public float top() -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Leonard Rosenthol Sent: Wednesday, February 22, 2006 4:48 PM To: [EMAIL PROTECTED]; itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] PdfImportPage Margins At 02:14 PM 2/22/2006, Jordan S. Jones wrote: >Is there a method for getting the margin values for a PDF Page read >in through the PdfReader? PDF pages have no such concept as a margin. Leonard ------------------------------------------------------------------------ --- Leonard Rosenthol <mailto:[EMAIL PROTECTED]> Chief Technical Officer <http://www.pdfsages.com> PDF Sages, Inc. 215-938-7080 (voice) 215-938-0880 (fax) ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions