We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

CustomTempFonts

Hi Aspose is filling up my c:\windows\temp\ directory with 100 000+ temp files in a subdirectory called CustomTempFonts. If I delete them the temps files are soon recreated. This is happening to the point where I have disk space issues. Is there a way to stop the files being created or at least be removed once they are no longer needed?

Regards

N

hi Nick

what Version of Aspose.Pdf are you using?

Waiting for your comments

Hi Luis

22.5 PFD 22.4

Regards

Nick

you can Make this steps:

  1. Remove CustomTempFonts folder
  2. upgrade to lastest version to Aspose.PDF

‘Aspose.PDF 22.7.0’

if you can show me a piece of code that use , it would be great

Regards

will give that a try and let you know.

Regards

N

Hi Luis

Version 22.7.0. has the same problem. I can now replicate the problem in our dev env and can isolate the methods causing the problem. Note rolling back to 22.3.0 fixes the issue

Code Example 1
private bool SavePdfAsDoc(Aspose.Pdf.Document pdf, String convertedFileName, )
{
try
{
pdf.Save(convertedFileName, Aspose.Pdf.SaveFormat.Doc);

            return true;
        }
        catch (Exception ex)
        {
            xxxx
        }

        return false;

    }

Code Example 2
private bool SavePdfAsText(Aspose.Pdf.Document pdf, String convertedFileName)
{
try
{
pdf.Save(convertedFileName, Aspose.Pdf.SaveFormat.Html);

            String text = System.IO.File.ReadAllText(convertedFileName, System.Text.Encoding.Default);
            text = new Earcu.Common.Routines.DataFormatting.HtmlStripper().Strip(text, 0, false);
            System.IO.File.WriteAllText(convertedFileName, text, System.Text.Encoding.Default);

            return true;
        }
        catch (Exception ex)
        {
               xxxx
        }

        return false;
    }

Also you need the source document to contain a custom font

@Nick.Wiechers

Please remove the custom folder from the disk and then try the latest version of Aspose.PDF for .NET 22.7.

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input PDF.
  • Please share the screenshot of custom folder files.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

1 Like

Hi Tahir

I’ve linked to a Visual Studio solution with a couple of projects which match how we are running Aspose. There is a WCF service which needs to run in IIS. The input PDF is included in the project.

Note, we get the issue with version 22.7.0 which is the version in the project. If you downgrade to 22.3.0 the issue goes away.

I’ve also done some analysis with Process Monitor. When using 22.7.0, the worker process has an extra operation: CreateFileMapping with value of File Locked With Only Readers". This doesn’t occur with 22.3.0

Regards

Nick

[https://drive.google.com/file/d/1Yku0dXKQQkkGdyj2b8D6_i1ldzrol54D/view?usp=sharing]

In addition to the above, the OS seems to be important to the issue. It will occur if the test solution runs on Windows 10 but not Windows 11. It also occurs on Windows Server 2016

@Nick.Wiechers

It seems like we do not have access to the files shared on Google Drive. Would you please share public link of the files so that we can download them? Also, have you tried executing the same functionality in a simple console application? Did you face the similar issue there as well?

oops, sorry, try this link https://drive.google.com/file/d/1lU_PDg38V4KBSTNx0mkr-XihXFxmknMV/view?usp=sharing

@Nick.Wiechers

We are checking it and will get back to you shortly.