Posted on: 10/8/2013 7:34:55 PM | Views : 787

I am trying to find a way to close the process that is holding the pdf file that I am creating. I have tried to dispose and close the stream after it is created but I get the message that The process cannot access the file '\server\PDFs\test.pdf' because it is being used by another process. Basically once test.pdf is created originally I then have a page where they can edit the data and it recreates a revised test.pdf. Any idea how I can close the process? I tried doing a while statement loop to keep trying but no luck?
 
 
'Create the original pdf Dim pdfWrite As PdfWriter = PdfWriter.GetInstance(Doc1, New FileStream(path & myUniqueFileName, FileMode.Create)) Doc1.Open() Dim test As String test = Session("PDF") Dim PDFHeader As String PDFHeader = Session("Header") Dim imagepath As String = Server.MapPath(".") & "/images/Header.png" Dim ...

Go to the complete details ...