Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

superscape

macrumors 6502a
Original poster
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Hi,

As part of a Mac OS X app (in Objective-C) I need to be able analyse a PDF and determine some characteristics. PDFKit is quite limited and I'm not sure that CGPDF is going to be much better unless I'm missing something when looking at the documentation.

I need to find out things like...

Minimum font size used
Minimum line thickness

...and so on. Does anyone know any third party frameworks/classes that could help, or any clever way I've overlooked?

Thanks
 
Last edited:

subsonix

macrumors 68040
Feb 2, 2008
3,551
79
Hi,

As part of a Mac OS X app (in Objective-C) I need to be able analyse a PDF and determine some characteristics. PDFKit is quite limited and I'm not sure that CGPDF is going to be much better unless I'm missing something when looking at the documentation.

PDFKit is, according to Apple a subframework of Quartz, so I do think you can get a lot more details from CGPDF* type functions.

There are numerous other functions you can use to traverse the hierarchy of a PDF file to access the various nodes and their children. For example, the CGPDFArray functions (CGPDFArrayGetBoolean, CGPDFArrayGetDictionary, CGPDFArrayGetInteger, and so forth) let you access arrays of values to retrieve values of specific types. You can find out more about how to use these functions by reading the PDF specification.

https://developer.apple.com/library.../dq_pdf_scan/dq_pdf_scan.html#//apple_ref/doc
 

superscape

macrumors 6502a
Original poster
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Yeah, thanks for that.

I'm coming to the conclusion that CGPDF is going to be the way to go. Just looks like one heck of a learning curve! I was hoping someone would have a nice, user friendly wrapper round it. CGPDF documentation here I come...
 

aly

macrumors member
Jul 3, 2006
88
0
Scotland
Depending on your budget you could check out Debenu Quick PDF Library (http://www.debenu.com). I use the Windows version on a daily basis in work but they recently released a OS X version. I haven't used the OS X version myself but the PC one can do all you ask and is very easy to use.
 

superscape

macrumors 6502a
Original poster
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Thanks for the tips, folks.

Just for the record, and in case anyone having similar problems stumbles across this thread in future, I ended up going the CGPDF route after all. Taking a thorough look at:

https://github.com/KurtCode/PDFKitten

..and the PDF specs over at Adobe set me on the right tracks. I'll warn those following in my footsteps though that its a complicated project!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.