Trevor Kramer wrote: > Hello, > > 18 months ago a question was posted to the list about determining the > margins of a page imported with PdfReader.
I remember a question about page boundaries and getting the mediabox, cropbox, artbox, etc... That's easy with iText. These boundaries can give an indication about margins, but except for the mediabox, they aren't necessarily present in a PDF file. > Some pseudo code was > posted demonstrating a solution of looping through all the objects on > the imported page to get their bounding boxes and computing the > largest dimensions from that. I assume that in your PDF the boundaries aren't present in the page dictionary, and that you want to parse the PDF syntax of the content to find out where the text begins and ends. This is a lot of work, because page content can be very complex (with XObjects, transformations, etc...). > The last message in the thread indicated > that this wasn't support yet in itext. Is this now possible with iText 2? iText can give you the syntax of the page content, but there's no method that gives you the 'margins' based on the content. There are too many hurdles: how to determine page headers/footers? Are they part of the content or not? What if a page is in fact a scanned image? And so on... You'll have to look elsewhere (maybe a PDF viewer app can give you this information). br, Bruno ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
