I'm using the acrobat activeX control in c#. Is there any way for me to get a) the aspect ratio of the pdf I've opened (be it from the activex control or through other programmable means) and b) the current level of zoom on the document?
Alternatively, is there a link anyone could provide to the pdf header format that I can perhaps parse myself.
Do they have any measure of width or height? Basically anything that gives me a method for setting the size of the activeX control to be appropriate.
If I open an "a4" style pdf in adobe reader and then open the bookmarks tab, the "aspect ratio" of the pdf itself is maintained as I resize the bookmarks tab. Ie, as the page width thins, the height also shrinks. How does Adobe Reader determining the initial height compared to width?
Sorry if these are really basic questions, but I don't generally deal with pdfs.
Is there any way to extract this information directly from parsing the pdf file? The ActiveX control is actually rather limited it seems, it allows me to set the zoom / scroll / page fit etc, but doesn't allow getting of this information. Nor does it allow me to get the page size. Do you happen to have a link to the .pdf header specification? or alternatively any information on parsing the text values in the document to extract this information?
Thanks for the help so far.
The PDF Standard is ISO 32000-1 and can be downloaded from <http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf>. There is "simple header", it's a structured file format and you would need to read & parse many aspects of it.
Also, be aware that EACH PAGE in a PDF stands alone - so each one can have its own size, orientation, scale factor, etc.
Cheers mate, thats got me exactly where I wanted to be. I'll parse the file for the first /type /page and then get the mediabox and/or cropbox for that page. Fortunately, the first page is the only one of any importance to me for the rendering. It will also help in scrolling through the pdf.