I'm using PDF Creator Version 1.5.0.3 Professional's ActiveX component with VB .NET. The ActiveX control is on a windows form. I can load pdf files and create new objects in the loaded file.
At this point, I am attempting to append the contents of one pdf to the end of another pdf (both of which were created/saved with PDF Creator). This is occasionally necessary as certain forms must be packaged together to be run as one print job.
I've tried each of the methods that seemed applicable: Merge, MergeEx, Append, AppendEx.
Example (AppendEx):
Code: Select all
If Me.strFileName = "" Then
MsgBox("Open a file before attempting to add another", MsgBoxStyle.OKOnly, "Error")
Exit Sub
End If
Me.OFD1.Title = "Choose the PDF file to Merge with the open file"
Me.OFD1.ShowDialog()
Dim strFileName2 As String = OFD1.FileName
Dim PDF2 As New ACPDFCREACTIVEX.PDFCreactiveX()
PDF2.Open(strFileName2, "")
Me.PDF1.SetLicenseKey("","")
Me.PDF1.AppendEx(PDF2)
Me.PDF1.Refresh()
Code: Select all
If Me.strFileName = "" Then
MsgBox("Open a file before attempting to add another", MsgBoxStyle.OKOnly, "Error")
Exit Sub
End If
Me.OFD1.Title = "Choose the PDF file to Merge with the open file"
Me.OFD1.ShowDialog()
Dim strFileName2 As String = OFD1.FileName
Me.PDF1.SetLicenseKey("","")
Me.PDF1.Append(strFileName2, "")
Me.PDF1.Refresh()
a) The method completes without throwing an exception, but attempting to view the appended pages throws a null reference exception on PDF1.
b) The method completes without throwing an exception, no attempt is made to view the appended pages, PDF1 is saved with a new filename, but the appended pages are not on the new file.
Any assistance would be appreciated.
Thanks,
Bryan Steiger