Udhay, If you’re wanting to analyse the visual appearance of a PDF then this can be quite tricky, for example you’ll have to know how to identify which content is the header and footer based on its location. PDF files are not structured like e.g. HTML, so you have to examine the low-level drawing commands.
The PDFBox API provides classes which can be used to read the visual contents, I’d recommend using the SVN trunk as it has new classes such as PDFGraphicsStreamEngine which you can subclass. This sort of analysis of PDF is not particularly easy and you will need to become familiar with the details of PDF graphics, which are well documented in the ISO spec: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf <http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf> Also check out the PageDrawer which is a fully working subclass of PDFGraphicsStreamEngine and shows how the graphics information can be processed. -- John > On 10 Nov 2014, at 00:59, U day <[email protected]> wrote: > > Hi, > I am currently working on PDF generated on my application. I perform > format testing(Position of contents, header footer, colour.etc) and > validation of fields(Mandatory to be populated, decimal places in grid > etc), generate a report based on test automation performed. Does PDF box > offer such Api's through which I will be able to test my PDF reports? > > Regards, > Udhay

