Skip to content

Commit 1765c50

Browse files
authored
Update Tutorials
1 parent a577716 commit 1765c50

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

Tutorials

+62
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,64 @@
1+
#Blog 1:
12
Click here to know more information about ComPDFKit for Windows:
23
https://www.compdf.com/blog/compdfkit-for-windows?utm_source=code_platforms_github&utm_medium=code_platforms_github_tutorialsblog&utm_campaign=outer_chain
4+
5+
#Blog 2:
6+
It's a frequent need to merge two or more PDFs like reports, brochures, product manuals, curriculum vitae, etc. ComPDFKit PDF SDK allows you to quickly and easily combine multiple PDF files into one new PDF document without having to render every single page of each PDF separately. The original PDF data will be preserved in the new document like annotations, font size, styles, and colors.
7+
8+
In this blog post, we will show you how simple it can be to merge two or more PDFs with ComPDFKit PDF SDK. Whether you need to combine the whole PDFs or the specific pages of PDF files, we are all here to help.
9+
10+
## Merge the Whole PDF
11+
ComPDFKit PDF SDK allows you to instantiate multiple CPDFDocument, and you can use the CPDFDocument API to merge two or more PDF files into a single one.
12+
13+
To merge PDF documents into one file, please use the following method:
14+
1. Create a blank PDF document.
15+
CPDFDocument document = CPDFDocument.CreateDocument();
16+
17+
2. Open the PDF documents that contain the pages you want to merge.
18+
// File path
19+
CPDFDocument document1 = CPDFDocument.InitWithFilePath("filePath");
20+
21+
// File path
22+
CPDFDocument document2 = CPDFDocument.InitWithFilePath("filePath2");
23+
24+
3. Merge all the pages from the documents you just opened, and import them into the blank PDF document.
25+
document.ImportPagesAtIndex(document1,"",document.PageCount);
26+
document.(document2,"",document.PageCount);
27+
28+
4. Save the document.
29+
// Save path
30+
document.WriteToFilePath("savePath");
31+
32+
##Choose Specific Pages to Merge
33+
34+
Looking to merge or add specific pages from one document to another, you can use pageRange of CPDFDocument.ImportPagesAtIndex(CPDFDocument otherDocument,string pageRange,int pageIndex) to set specific pages.
35+
36+
1. First, you should follow the steps below:
37+
- Create a blank PDF document.
38+
CPDFDocument document = CPDFDocument.CreateDocument();
39+
40+
- Open the PDF documents that contain the pages you want to merge.
41+
// File path
42+
CPDFDocument document1 = CPDFDocument.InitWithFilePath("filePath");
43+
44+
// File path
45+
CPDFDocument document2 = CPDFDocument.InitWithFilePath("filePath2");
46+
47+
2. Then, choose the pages you want to merge. Merge all the pages you just chose, and import it into the blank PDF document. The code for this step looks like this:
48+
document.ImportPagesAtIndex(document1,"1-10",document.PageCount);
49+
document.ImportPagesAtIndex(document2,"1-10",document.PageCount);
50+
51+
3. At last, save the document.
52+
// Save path
53+
document.WriteToFilePath("savePath");
54+
55+
56+
##How to integrate
57+
To get started, you need a ComPDFKit PDF SDK license key first and download the package of the ComPDFKit PDF SDK for Windows. All you need to do is contact us for a free trial. Then, follow the steps below to integrate the merging function.
58+
59+
1. Create a new Windows project in C#.
60+
2. Integrate ComPDFKit PDF SDK into your project.
61+
3. Apply the license key.
62+
4. Display a PDF document.
63+
64+
You can find the detailed steps and code samples in our document.

0 commit comments

Comments
 (0)