PDFium Delphi Component Docs

PrintPaperHandling 属性

组件: TPdf  ·  单元: PDFium
文档 /ViewerPreferences /Duplex 提示的解码值,也就是 PDF 作者希望打印对话框默认采用的单面 / 双面纸张处理模式

语法

property PrintPaperHandling: TPrintPaperHandling; // read only

说明

/ViewerPreferences 的 /Duplex 条目推荐 打印机应如何处理文档的纸张(PDF 32000-1 § 12.2 Table 150)。PDFium 解码命名的标记,并将其作为 TPrintPaperHandling 枚举值暴露:

与其他打印相关属性一样,这是作者烘焙到文件中的 提示;PDFium 不强制它。要遵守该偏好,你的打印层必须 将值转发给打印机驱动程序。在 Windows GDI 下, 在 StartDoc 之前调用 SetPdfPrintPaperHandlingDevMode 将 DEVMODE.dmFields 和 DEVMODE.dmDuplex 设置为 DMDUP_SIMPLEX、 DMDUP_VERTICAL(长边)或 DMDUP_HORIZONTAL(短边)

将此属性与 PrintScaling、 PrintCopies 和 PrintPageRanges 配对,使文档的所有打印 偏好作为一个一致的默认集填充你的打印对话框

备注

示例

// 预选双面单选按钮并准备打印机 DevMode
begin
  case Pdf1.PrintPaperHandling of
    phSimplex: radioSimplex.Checked := True;
    phDuplexFlipLongEdge: radioDuplexLong.Checked := True;
    phDuplexFlipShortEdge: radioDuplexShort.Checked := True;
  else
    radioPrinterDefault.Checked := True; // phUndefined
  end;

  if SetPdfPrintPaperHandlingDevMode(DevMode, Pdf1.PrintPaperHandling) then
    ApplyPrinterDevMode(DevMode);
end;

参见

PrintCopies, PrintScaling, PrintPageRanges, SetPdfPrintPaperHandlingDevMode, ViewerPreference