How to get actual pdf page size in iPad?

user344799 picture user344799 · Jun 15, 2010 · Viewed 9.6k times · Source

How can I get PDF page width and height in iPad? Any document or suggestions on how I can find this information?

Answer

Ege Akpinar picture Ege Akpinar · Apr 3, 2013

I was using the answers here until I realised a one-liner for this

CGRect pageRect = CGPDFPageGetBoxRect(pdf, kCGPDFMediaBox);
// Which you can convert to size as
CGSize size = pageRect.size;

Used in Apple's sample ZoomingPDFViewer app