Merging or combining multiple PDFs into a single file makes it much easier to manage and organize your documents.
You won't need to keep track of multiple files, which can be especially useful for projects, reports, or presentations that have multiple components.
With scConverter you can easily add PDF merging functionality to your application.
There are 4 functions available related to merge that are very easy to use. With these functions You can combine all pages, or only a selection of pages, from the individual PDF files.
The merge interface consists of the following functions:
To create a new merged PDF file, you start with calling the PDFMergeInit function.
Then you can start adding files and pages using one of the following two functions:
The first function, PDFMergeAddFile, will add all pages from the given file to the combined PDF file.
The second function, PDFMergeAddFileEx, have a second parameter that may be used to control which pages to include from the added PDF file.
Passing for example a page string like "1,2,3,10" will only 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 output PDF.
Sample code for merging pages from 3 different PDF files:
The new file named output.pdf will then contain:
You may also take a look at the scMergePDF C# sample
to see see how you may use scConverter in an application.
This sample shows a preview of each page in the source PDF file, and let you include all or just selected pages into the combined final PDF.
The complete source code for this sample application is included in the SDK download.