Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default paper size and unit for PDF documents on iOS

For creating PDF documents in iOS, in the official documentation (http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GeneratingPDF/GeneratingPDF.html#//apple_ref/doc/uid/TP40010156-CH10-SW3), the default size is given as 612x792, which has a ratio of 1.29412.

// Create the PDF context using the default page size of 612 x 792.
UIGraphicsBeginPDFContextToFile(pdfFileName, CGRectZero, nil);
CFRange currentRange = CFRangeMake(0, 0);
NSInteger currentPage = 0;
BOOL done = NO;
do {
// Mark the beginning of a new page.
   UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, 612, 792), nil);

However, default size of an A4 paper of international standard IS0216 is 210x297mm, which has an aspect ratio of 1.41429. So, my questions are: What is the unit of Apple's standard? Is this 612x792 dimension identical with A4? Are the printing margins, etc., included?

like image 428
mcy Avatar asked Aug 04 '12 13:08

mcy


People also ask

What is the paper size of PDF?

Always use the 8.5" x 11" paper size when scanning or converting documents to PDF files.


1 Answers

PDF and PostScript use "PostScript points" as a unit. A PostScript point is 1/72 inch. So the default page size is

612 x 792 points = 8.5 x 11 inch = 215.9 mm x 279.4 mm

This is the US Letter paper size.

The bounds rectangle in UIGraphicsBeginPDFPageWithInfo() defines the so-called "media box" of the PDF page. The media box is the size of the medium on which the page should be printed and therefore includes the margins.

like image 187
Martin R Avatar answered Sep 29 '22 13:09

Martin R