Please verify if this CGM file can be converted on linux

This fails to convert for me,
1107729-05.zip (23.1 KB)

either with a corrupt image, or with a ‘no suitable system fonts found’ error.

@kjpual

Would you please share the code snippet that you are using in your environment for the conversion?

Is it really necessary to ask that? I’m using your own example:

  var document = new Aspose.Pdf.Document(inputFilePath, new Aspose.Pdf.CgmLoadOptions());
    var renderer = new Aspose.Pdf.Devices.PngDevice();
    renderer.Process(document.Pages[1], outputFilePath);

@kjpual

Yes, we prefer testing the scenario using same code snippet and files to reproduce the issue. There can be intermediate settings during such type of conversion that can cause the issue because Aspose.PDF does not directly convert a CGM file into PNG. It first converts it into PDF and then generates PNG from the obtained PDF document. Nevertheless, we are testing the case in our environment and will be sharing our feedback with you shortly. Please give us little time.

Here are 40 other tricky CGM images, please ensure these can be converted (on Linux)
badcgm.zip (704.6 KB)

@kjpual

We have been investigating it. One last thing, are you using Linux Container (docker)? If yes, can you please share your docker file as well?

We’re not using docker, but are using Amazon Linux 2 in EC2.

Linux sgml.localdomain 4.14.334-252.552.amzn2.x86_64 #1 SMP Tue Jan 2 17:47:37 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

@kjpual

Thanks for sharing requested information. It looks like the issue is happening due to the dependency on System.Drawing assembly which is no more supported in Linux and .NET 6.0. Would you please try installing Aspose.Pdf.Drawing instead of using Aspose.PDF for .NET?

You can simply uninstall existing API reference and install Aspose.Pdf.Drawing using NuGet Package Manager. We released this API as beta version to test the performance under Linux like environments. It does not have any dependency on System.Drawing.

We were already using Aspose.Pdf.Drawing for this ticket.

@kjpual

Sorry for the trouble. It would take us some time to configure this particular environment and test the case accordingly. Initially, we can say that such issues mostly occur due to two reasons. One was already ruled out by making sure the usage of Aspose.Pdf.Drawing and second is missing fonts. Such issues go away most of the time by just installing msttcorefonts packge in Linux. You can try that as well. If error is happening due to some specific missing font(s), full stack trace can also help in investigation.

Furthermore, we are generating an investigation ticket in our issue management system to deeply analyze this use case and will be sharing its ID with you shortly.

@kjpual

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-56423

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.