I am trying to create PDF's using iTextSharp. When creating the first PDF I don't encounter any problems. Once I want to create a second PDF file I get the error that there is no access to the file. I think I am not disposing the files correctly. Below you will find a copy of the PDF generating code.
Private Sub GeneratePDF()
Try
Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(pdfDoc, New FileStream("\\verkoop\offerte v2\Offerte " & offertenummer2 & "-" & offertenummer & …Run Code Online (Sandbox Code Playgroud)