Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding the page size of a pdf file

Status
Not open for further replies.

ids4ids

Technical User
Jun 17, 2004
26
0
0
RO
How can I find the page size of a PDF file from my vfp application ?
(I want to know if a PDF file is format A4 or A3)
 

It shouldn't be too difficult to work this out.

Create two identical PDFS -- one for A4 and the other for A3. Open each of them in a text editor. You'll see a block of text at the start of the file, this being the file header. Somewhere in there is the page size. This is plain text, so you only have to look to see what's different between the A3 and the A4 versions.

Once you know that, it should be easy to read the file into a variable (using FILETOSTR()) and test the relevant characters.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
It's just additional information for who want to do this.
 
ids4ids

What you suggest will work for a single page pdf but will not be reliable for multipaged pdfs.

It is possible for a pdf to be made up of different contacanated postscript files each with a different page size.

Apart from special pages sizes created by applications there are 39 known sizes, some of which are duplicates in size but differ in name.

One freeware option would be to use the ImageMagick object or the binary identify.exe to determine the page size(s)

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander.com
PDFcommander.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top