【问题标题】:How to set the Legal Page size for PDF created using UIPrintPageRenderer?如何为使用 UIPrintPageRenderer 创建的 PDF 设置 Legal Page 大小?
【发布时间】:2020-05-05 10:29:22
【问题描述】:

我正在设置这个:

static CGFloat LegalPageWidth = 612.0;
static CGFloat LegalPageHeight = 1008.0;

作为在 UIPrintPageRenderer 中创建 PDF 的合法页面大小(即 8.5 x 14 英寸)为“paperRect”,但当我打印 PDF 时,其大小始终为 A4(即 612 x 792 = 8.5 x 11 英寸)。

获取 Legal Page size PDF 的正确方法是什么?

【问题讨论】:

    标签: ios uiprintpagerenderer


    【解决方案1】:

    UIGraphicsBeginPDFPage 使用默认大小创建新页面,而 UIGraphicsBeginPDFPageWithInfo 函数可让您自定义页面大小或自定义 PDF 页面的其他方面。

    参考这个 https://developer.apple.com/library/archive/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GeneratingPDF/GeneratingPDF.html#//apple_ref/doc/uid/TP40010156-CH10-SW3

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-31
      • 2023-03-13
      • 1970-01-01
      • 1970-01-01
      • 2013-01-13
      • 1970-01-01
      相关资源
      最近更新 更多