ApplyRepeatedPageFragment
頁面版面配置、標籤式 PDF、效能
描述
在每個所選頁面放置一個擷取的 Form XObject,並將每次放置標記為邏輯結構樹之外的 artifact
擷取的串流與其資源由所有放置共用,避免重複建構相同的頁首、群組標籤、背景、頁碼、浮水印或裝飾片段
語法
Delphi
Function TPDFlib.ApplyRepeatedPageFragment(CaptureID: Integer;
Const PageRange: WideString; Left, Top, Width, Height: Double;
Const ArtifactType, ArtifactSubtype: WideString): Integer;ActiveX
Function PDFlib::ApplyRepeatedPageFragment(CaptureID As Long,
PageRange As String, Left As Double, Top As Double, Width As Double,
Height As Double, ArtifactType As String,
ArtifactSubtype As String) As LongDLL
int DLApplyRepeatedPageFragment(int InstanceID, int CaptureID,
const wchar_t* PageRange, double Left, double Top, double Width,
double Height, const wchar_t* ArtifactType,
const wchar_t* ArtifactSubtype);
int DLApplyRepeatedPageFragmentA(int InstanceID, int CaptureID,
const char* PageRange, double Left, double Top, double Width,
double Height, const char* ArtifactType,
const char* ArtifactSubtype);參數
| CaptureID | 由 EndFormXObject 或目前文件中另一個 Form 擷取 API 傳回的可重複使用擷取 |
|---|---|
| PageRange | 頁面範圍運算式,或對所有頁面使用空字串 |
| Left, Top, Width, Height | 傳遞給 DrawCapturedPage 的放置矩形;座標必須為有限值,尺寸必須為正值 |
| ArtifactType | Pagination、Layout、Page 或 PDF 2.0 的 Background 其中之一 |
| ArtifactSubtype | 除非 ArtifactType 為 Pagination,否則為空;可接受的標準值為 Header、Footer、Watermark、PageNum、LineNum、Redaction 與 Bates |
傳回值
傳回已放置片段的頁面數量;驗證失敗、範圍為空或目前 API 範圍無法變更頁面時傳回 0
備註
函數會保留呼叫者所選的頁面與繪圖器狀態
Background、PageNum、LineNum、Redaction 與 Bates 會把輸出功能版本提高到 PDF 2.0
重複放置一律視為 artifact;當第一次出現屬於閱讀順序時,請在本呼叫之外另外繪製語義上的出現
範例
PDF.BeginFormXObject(0, 0, 180, 24);
PDF.PrintText(0, 8, 'Confidential draft');
FragmentID:= PDF.EndFormXObject;
if PDF.ApplyRepeatedPageFragment(FragmentID, '2-end', 36, 806,
180, 24, 'Pagination', 'Header')= 0 then
HandleLayoutError;