DynamicPDF doesn't delete temp files .tiff

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Converter for .NET (v3)  /  DynamicPDF doesn't delete temp files .tiff

DynamicPDF Converter for .NET (v3) Forum

Hi, We are converting tiff images to pdfs in Azure Function App under Consumption Plan which comes with 500 mb free space. We read a blob from the stroage and pass bytes to Converter. When we load test, we are observing that DynamicPDF converter is not cleaning up .tiff files its writing into Temp folder.  Over a period of time, worker instances are running out of free space and results in large number of failures.

byte[] fileContents = <from blob>
var imageConverter = new ImageConverter(fileContents);
var pdfBytes = imageConverter.Convert();
return new MemoryStream(pdfBytes);

Is there a way to get the name of the temporary file converter is using ....they all look like this with UUIDs "f98cd396-bf15-4e79-bc29-d405ed410839.tiff".
Maybe I can delete the temporary file before exiting the function app.

We recently bought the license to put our app into production but  unable to move forward with this major issue. Please advise.

Thanks
 
Posted by a ceTe Software moderator
Hi,

Our DynamicPDF Converter product deletes temporary file after each conversion but if any are left then they will be cleared periodically.

You can set a temporary directory path in the client application and handle the files on your end. Please make sure that the user account under which the application is running has sufficient permissions to read and write temp files to this directory.

Here is a code sample:

            ConversionOptions.TemporaryDirectory = @"C:\Temp\";
            ImageConverter imgconverter = new ImageConverter(@"Image file path");
            byte[] pdfBytes= imgconverter.Convert();

Thanks,
ceTe Software Support Team
We are in Azure cloud, Thread maynot be able to run once Function App exits, it leaves files in temporary folder and never gets cleaned up.

Your suggestion to set temp folder is a static property that is needed only one time per process, not per invocation, correct?

If I have a multi threaded application converting several tiffs, I want to set a temporary folder unique to each invocation. It appears this is not possible to do. Is my understanding correct?
Posted by a ceTe Software moderator
Hi,

Yes, TemporaryDirectory is a static property and initialized only once at the start of first conversion. This will remain the same for the whole conversion process until the application closes.

There is no option to set a different temp folder for each conversion.

By default, temporary files will be cleared periodically by Converter product.

Also, if you are converting only image types to PDF then please try using DynamicPDF Core Suite for .NET product and see if it works for you. Please refer to the documentation on Tiff images here.

Feel free to download fully functional evaluation edition of DynamicPDF Core Suite for .NET product from NuGet(Package ID: ceTe.DynamicPDF.CoreSuite.NET) or from our website here.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 3:40 PM.