如何插入PDF文件到另外一个PDF文件的指定位置

作者:控件中国网   出处:控件中国网   2015-09-08 09:39:19   阅读:8

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");

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat