My project requires that I create a single pdf and save it in a directory. Then add that pdf to another pdf in a separate directory.
Code:
Private Sub AddInvoiceToDaily(SingleFile As String, CombinedFile As String)
Dim doc1 As PdfDocument = PdfReader.Open(SingleFile, PdfDocumentOpenMode.Import)
Dim doc2 As PdfDocument
Dim page As PdfPage = doc1.Pages(0)
If Not File.Exists(CombinedFile) Then
doc2 = doc1
Else
doc2 = PdfReader.Open(CombinedFile, PdfDocumentOpenMode.Import)
doc2.AddPage(page)
End If
doc2.Save(CombinedFile)
End Sub
Regardless of whether the file exists I get this error message: "The document cannot be modified." at "Doc2.save(CombinedFile).
Any help would be greatly appreciated.
Brad