I'm evaluating Aspose.Pdf.Kit for a program I am writing and it seems ideal for my purposes but for one issue.
I'm trying to concatenate two files and save the output to disk. The code given below does the job very well, creating the new file and writing it to disk.
When I run it as part of the program, however, despite the subroutine doing what I requested, it throws up a Microsoft Development Environment error as follows:
An unhandled exception of type 'System.IO.IOException' occurred in aspose.pdf.kit.dll
Additional information: Bad password!
The code is a minor modification of your example code:
Public Sub Concatenate(ByVal inputfile1 As String, ByVal inputfile2 As String, ByVal outputfile As String)
'read input Pdf documents
Dim inStream1 As FileStream = File.Open(inputfile1, FileMode.Open, FileAccess.Read, FileShare.Read)
Dim inStream2 As FileStream = File.Open(inputfile2, FileMode.Open, FileAccess.Read, FileShare.Read)
Dim OutStream As FileStream = File.Open(outputfile, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite)
Dim pdfInfo As PdfFileInfo = New PdfFileInfo(OutStream)
'set new PdfFileEditor object
Dim pdfEditor As PdfFileEditor = New PdfFileEditor
'generate new Pdf file stream.
pdfEditor.Concatenate(inStream1, inStream2, OutStream)
'save the information
I'd appreciate the help.