PDFium Delphi Component 文件

PrintPaperHandling 屬性

元件: TPdf  ·  單元: PDFium
文件 /ViewerPreferences /Duplex 提示的已解碼值 — 也就是 PDF 作者希望列印對話框預設採用的單面或雙面紙張處理模式

Syntax

property PrintPaperHandling: TPrintPaperHandling; // read only

Description

/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 搭配,讓文件的所有列印偏好以一套一致的預設組合填入您的列印對話框

Remarks

Example

// Pre-select the duplex radio buttons and prepare the printer 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;

See Also

PrintCopies, PrintScaling, PrintPageRanges, SetPdfPrintPaperHandlingDevMode, ViewerPreference