PDFtoolkit VCL是一款用于Delphi和C++ Builder下的PDF文档处理控件,可以帮助开发人员进行PDF文件的插入、删除、提取文本和图片、合并多个PDF文件,设置文档属性以及水印等,使用简单方便,下面的代码主要是讲如把一个PDF文件插入到现有的PDF文件的指定位置,具体如下:
Delphi:
begin
// Load a PDF Document
gtPDFDocument1.LoadFromFile('Input1.pdf');
// Insert pages from another document into current document after page 1
gtPDFDocument1.InsertPagesFrom('Input2.pdf', '1-5', 1);
// Save the document to file.
gtPDFDocument1.SaveToFile('Output.pdf');
end;
C++Builder:
// Load a PDF Document
gtPDFDocument1->LoadFromFile("Input.pdf");
// Insert pages from another document into current document after page 1
gtPDFDocument1->InsertPagesFrom("Output.pdf", "1-5", 1);
// Save the document to file.
gtPDFDocument1->SaveToFile("Output.pdf");