/ViewerPreferences /Duplex hint —
the simplex / duplex paper-handling mode the PDF author would like the print dialog to default
to.property PrintPaperHandling: TPrintPaperHandling; // read only
The /Duplex entry of /ViewerPreferencesは、プリンターが文書の用紙をどのように扱うべきかを推奨します (PDF 32000-1 § 12.2 Table 150)。PDFium は名前付きトークンをデコードし、TPrintPaperHandling enum value:
phUndefined— エントリが存在しません。「プリンターまたはビューアーの既定値を使用」として扱いますphSimplex — /Simplex. Single-sided printing.phDuplexFlipShortEdge — /DuplexFlipShortEdge. Two-sided printing, pages flip along the short edge (typical for landscape-style notebooks and calendars).phDuplexFlipLongEdge — /DuplexFlipLongEdge. Two-sided printing, pages flip along the long edge (the standard portrait book-style binding).他の印刷関連プロパティと同様、これは作成者がファイルに埋め込んだヒントであり、PDFium は強制しません。この設定に従うには、印刷レイヤーが値をプリンタードライバーへ渡す必要があります。Windows GDI ではSetPdfPrintPaperHandlingDevMode to set DEVMODE.dmFields and
DEVMODE.dmDuplex to DMDUP_SIMPLEX,
DMDUP_VERTICAL (long edge), or DMDUP_HORIZONTAL (short edge)
before StartDoc.
Pair this property with PrintScaling, PrintCopies and PrintPageRanges so all of the document's print preferences populate your print dialog as one consistent default set.
phUndefined.phSimplex and let the user override.
// 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;