PDFium Delphi Component Docs

PrintPaperHandling プロパティ

コンポーネント: TPdf  ·  ユニット: PDFium
文書の /ViewerPreferences /Duplex ヒントのデコード値 — PDF 作成者が印刷ダイアログで既定にしたい simplex / 両面用紙取り扱いモード

Syntax

property PrintPaperHandling: TPrintPaperHandling; // read only

Description

/ViewerPreferences の /Duplex エントリはプリンターが文書の用紙をどう扱うべきかを推奨します(PDF 32000-1 § 12.2 表 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