Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Sep 06, 2016 4:11 pm

I have this simple app and the merge isn't working. Files are attached.

Code:

Dim sFiles As String = ""
Dim i As Integer = 0
Dim files As [String]() = New [String]() {"C:\Temp\MCP\2016002573SNS.pdf", "C:\Temp\MCP\2016006270SNS.pdf", "C:\Temp\MCP\2016007561SNS.pdf"}

Dim docs As PdfDocument() = New PdfDocument(files.Length - 1) {}

For i = 0 To files.Length - 1
docs(i) = New PdfDocument(files(i))
Next
i = 0

While i < docs(1).Pages.Count
docs(0).InsertPage(docs(1), 0)
i = i + 1
End While

i = 0

While i < docs(2).Pages.Count
docs(0).InsertPage(docs(2), 0)
i = i + 1
End While

docs(0).SaveToFile("C:\temp\MCP\Test.pdf", FileFormat.PDF)

For Each doc As PdfDocument In docs
doc.Close()
Next

nsalatka
 
Posts: 3
Joined: Fri Jan 29, 2016 5:17 pm

Wed Sep 07, 2016 6:15 am

Dear nsalatka,

Thanks for your inquiry.
I have noticed your issue and posted it to our Dev team. We will inform you as long as there is any progress.
Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Sep 09, 2016 3:44 am

Dear nsalatka,

Thanks for your waiting.
After investigation,I am afraid that the files cannot been merged as xml form cannot been merged. You can check it in Adobe acrobat.
Sorry for inconvenience caused.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDF