PDFium Delphi Component 文件

BuildPdfImpositionPlan 函式

單元: PDFium
以純粹的紙張、面與插槽規劃,計算 N-up 或冊子拼版版面

Syntax

function BuildPdfImpositionPlan(PageCount: Integer;
  const Options: TPdfImpositionOptions): TPdfImpositionPlan;

Parameters

PageCountInteger
OptionsTPdfImpositionOptions

Return Value

TPdfImpositionPlan

Description

BuildPdfImpositionPlan 會計算每個來源頁面落在輸出紙張的哪個位置,而不需開啟文件,因此版面可以在 TPdf.ImportImposed 執行之前先行預覽

在 pimNUp 模式下,每個輸出面承載 Columns 乘以 Rows 的插槽網格,欄數或列數為 1 到 32,且每面最多 256 個插槽;Duplex 會讓每張紙的面數加倍,頁數也會補滿至整個面

在 pimBooklet 模式下,規劃結果是 2-up 騎馬釘裝訂:頁數會補滿至 4 的倍數,每張紙的正面配對最後一個與第一個邏輯頁面,背面則承載內側配對

ReverseSheets 會反轉邏輯紙張順序,CreepPerSheet 則以 creep 乘以邏輯紙張索引,將外側插槽欄位向內或向外平移,藉此重現騎馬釘的疊移效果

Plan.Slots 中的每個插槽都會記錄 SheetIndex、SideIndex、SlotIndex、SourcePageIndex、Creep,以及輸出頁面內的 Left、Bottom、Width、Height 放置位置;SourcePageIndex 為 -1 表示空白填補插槽

Plan 也會回報 SourcePageCount、PaddedPageCount、SheetCount、SideCount、SlotsPerSide,以及解析後的網格幾何資訊

Remarks

Example

Options := TPdfImpositionOptions.Default;
Options.Mode := pimBooklet;
Plan := BuildPdfImpositionPlan(Pdf.PageCount, Options);

See Also

TPdf.ImportImposed