Hi Guys,
I'm hoping that someone can help me as this is driving me nuts. I need to write a quick 'n' dirty application that can look a PDF files in a directory and output the page dimensions for each document (we're testing that they are all A4). While Apple seems to have delivered a useful framework in 10.4, PDF Kit, I'm damned if I can find a method in either PDFDocument or PDFPage that will return the page dimensions of the PDFDocument object. The PDFDocument object has an instance method called "documentAttributes" but that only seems to return information about the author, etc. (5 keys in all). There is a boundsForBox method for PDFPage that will return an instance of NSRect (depending upon which of the constant values specified you use, and I'm not sure what each of them is meant to do) but I have no idea how to translate an NSRect struct into something like 21.0 x 29.7cm.
Any ideas?
Regards,
Kelmon
I'm hoping that someone can help me as this is driving me nuts. I need to write a quick 'n' dirty application that can look a PDF files in a directory and output the page dimensions for each document (we're testing that they are all A4). While Apple seems to have delivered a useful framework in 10.4, PDF Kit, I'm damned if I can find a method in either PDFDocument or PDFPage that will return the page dimensions of the PDFDocument object. The PDFDocument object has an instance method called "documentAttributes" but that only seems to return information about the author, etc. (5 keys in all). There is a boundsForBox method for PDFPage that will return an instance of NSRect (depending upon which of the constant values specified you use, and I'm not sure what each of them is meant to do) but I have no idea how to translate an NSRect struct into something like 21.0 x 29.7cm.
Any ideas?
Regards,
Kelmon