The interface is very easy to use, and you may combine all pages, or a selection of pages, from the individual PDF files.
The merge interface consist of 4 methods:
- HRESULT PDFMergeInit(void)
- HRESULT PDFMergeAddFile(BSTR PDFFileName)
- HRESULT PDFMergeClose(BSTR PDFOutputName)
- HRESULT PDFMergeAddFileEx(BSTR PDFFileName, BSTR PageInformation
To create a new combined/merged PDF file you start with a call to the PDFMergeInit method. You then add files using one of two methods; PDFMergeAddFile or PDFMergeAddFileEx.
The first method, PDFMergeAddFile, will add all pages from the given file to the combined PDF file.
The second method, PDFMergeAddFileEx, have a second parameter that may be used to control which pages to include, e.g.: "1,2,3,10" will include page 1,2,3 and 10 from the given PDF.
When all required files and pages are added you create the new PDF using PDFMergeClose, the parameter is the name of the resulting PDF.
Sample code to combine/merge 3 PDFfiles:
scconverter.PDFMergeInit(); //Start a new PDF
scconverter.PDFAddFile("filea.pdf"); //Add all files from filea.pdf
scconverter.PDFAddFileEx("fileb.pdf", "1,2" ); //Add page 1 and 2 from fileb.pdf
scconverter.PDFAddFileEx("filec.pdf", "2,3,5,10); //Add page 2,3,5 and 10 from filec.pdf
scconverter.PDFMergeClose( "output.pdf" ); //Create new file named output.pdf
output.pdf will contain:
- All pages from filea.pdf,
- Page 1 and 2 from fileb.pdf
- Page 2,3,5 and 10 from filec.pdf
Please also take a look at the sample named scMergePDF:
This sample shows a preview of each page in the source PDF, and let you include all or individual pages into the combined PDF.
Read more about scConverter here:
Download scConverter SDK here:
The scConverter DLL documentation can be found here: