Unable to delete pdf file after pdf to docx conversion (in the same function call)
- October 1, 2021
- 3 replies
- 2939 views
I have followed the code reference (ref: https://www.adobe.io/apis/documentcloud/dcsdk/pdf-services.html) needed for converting a PDF to DOCX, and that works as expected. However the same code also locks the PDF file and I am unable to delete the PDF file during the same function call.
I am attaching both the code that I have written as well as the error that I get on trying to delete the PDF file that is opened by
FileRef sourceFileRef = FileRef.CreateFromLocalFile(fullFilesPath + pdfFile);
I checked for a dispose method for any of the objects that are initiated from the Adobe Services API, but there are none, I have (if you see the screenshot named PDF to word code) also set all objects to null, but that also does nothing. Regardless there should either be a close method to close the PDF file that was opened or a dispose method to do the same.
Requesting a quick reply on this.
