PDF output file locked

Hi there

I’m just getting started with the PDF.Kit and have hit a problem

One of my unit tests is setting the PDF.Kit.Form SrcFileName to an invalid file (it’s a plain text file, rather than a PDF) … this is to check out when the user doesn’t follow the instructions !!
What seems to happen is the destination file is left open so my cleanup code throws an IOException "… process cannot access … being used by another process"

I was going to use a Using block, but seems the Form doesn’t implement IDisposable

Is there someway to handle this and cleanly close down ?

Found an answer … use the PdfFileInfo BePdfFile method before using the Form

steveculshaw:
Hi there

I’m just getting started with the PDF.Kit and have hit a problem

One of my unit tests is setting the PDF.Kit.Form SrcFileName to an invalid file (it’s a plain text file, rather than a PDF) … this is to check out when the user doesn’t follow the instructions !!
What seems to happen is the destination file is left open so my cleanup code throws an IOException "… process cannot access … being used by another process"

I was going to use a Using block, but seems the Form doesn’t implement IDisposable

Is there someway to handle this and cleanly close down ?