HiI'm generation PDF´s on the fly from a database. The database also contains .doc files. I covert them to PDF files, hoping it would be easy to put them in the right place of the PDF generated on the fly.
The conversion of the doc file goes well. But I get a "Object reference not set to an instance of an object".
I think there is a problem with the pdfCopy.
Public Sub mergePdf(pathToMergePdf As String, currentPdf As Document)
Using fw As New FileStream(pathToMergePdf, FileMode.Open, FileAccess.Read)
Dim pdfCopy As PdfSmartCopy = New PdfSmartCopy(currentPdf, fw)
Dim pdfR As PdfReader = New PdfReader(pathToMergePdf)
For i = 1 To pdfR.NumberOfPages + 1
Dim p As PdfImportedPage = pdfCopy.GetImportedPage(pdfR, i)
pdfCopy.AddPage(p)'Object reference not set to an instance of an object:
Next
End Sub
Go to the complete details ...