iOS上PDF文档的默认纸张大小和单位

时间:2012-08-04 13:44:25

标签: objective-c ios pdf-generation

要在iOS中创建PDF文档,请在官方文档(http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GeneratingPDF/GeneratingPDF.html#//apple_ref/doc/uid/TP40010156-CH10-SW3)中,默认大小为612x792,其比率为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);

然而,国际标准IS0216的A4纸的默认尺寸为210x297mm,其纵横比为1.41429。所以,我的问题是: Apple标准的单位是什么? 这个612x792尺寸与A4相同吗? 是否包括打印边距等?

1 个答案:

答案 0 :(得分:35)

PDF和PostScript使用“PostScript点”作为一个单元。 PostScript点是1/72英寸。因此默认页面大小为

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

这是美国信件纸张尺寸。

UIGraphicsBeginPDFPageWithInfo()中的边界矩形定义了PDF页面的所谓“媒体框”。媒体框是应在其上打印页面的媒体大小,因此包括边距。

相关问题