function ImportPagesByIndex(
Source : TPdf;
const PageIndices: array of Integer;
InsertAt : Integer = 0): Boolean;
ImportPagesByIndex copies an explicit set of pages from
Source into THIS document. Unlike
ImportPages, which parses a one-based range string
("1-3,7,10-12"), ImportPagesByIndex takes the indices directly as a
zero-based Pascal open array — ideal when the page list comes
from program logic (a checked list of thumbnails, a filtered query,
etc.)
InsertAt, İLK içe aktarılan sayfanın sıfır tabanlı hedef indeksidir: mevcut 1. sayfadan
önce eklemek için 0, sona eklemek için PageCount geçin. Aralık dışı
InsertAt değerleri PDFium tarafından kırpılır
Her sayfayı Source'tan içe aktarmak için boş bir PageIndices dizisi
geçin (C ABI düzeyinde nil geçmekle eşdeğerdir). Her şeyi tek çağrıda
içe aktarmanın kısa yolu budur
Returns True on success. Returns False
if any index is out of range in Source or if either
document is not Active. Raises EPdfError
when Source is nil
MovePages to reorder in placePageIndices içindeki indeksler Source'un o andaki durumuna göre değerlendirilir; çağrıdan sonra Source'ta yapılan yeniden sıralamalar veya silmeler içe aktarılanları geriye dönük değiştirmezImportNPagesToOne, sayfaları kopyalamak yerine yeni bir dokümana bir araya getirmek (N-up ızgara) gerektiğinde kullanılır
var
Source: TPdf;
begin
Source := TPdf.Create(nil);
try
Source.FileName := 'C:\Report.pdf';
Source.Active := True;
// Import pages 1, 3, 5 (zero-based: 0, 2, 4) and append
Pdf1.ImportPagesByIndex(Source, [0, 2, 4], Pdf1.PageCount);
// Or import every source page at the start of Pdf1
// Pdf1.ImportPagesByIndex(Source, [], 0);
finally
Source.Free;
end;
end;