Missing text after converting from DXF to PDF

Hi,
I’m using Aspose CAD 22.4 and found that there is an issue when converting DXF to PDF, some text are missing and replaced by “?” chars in PDF output file.

Here is sample code:

             using(var fileStream = new FileStream(inFile, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
            using(var image = Image.Load(fileStream))
            {
                // Create an instance of CadRasterizationOptions and set its various properties
                var rasterizationOptions = new CadRasterizationOptions
                {
                    BackgroundColor = Color.White,
                    PageWidth = image.Width,
                    PageHeight = image.Height
                };
                // Create an instance of PdfOptions
                var pdfOptions = new PdfOptions
                {
                    // Set the VectorRasterizationOptions property
                    VectorRasterizationOptions = rasterizationOptions
                };
                image.Save(outFile, pdfOptions);

Here is my sample file and output I’ve got after converting: issue_CAD.zip (577.1 KB)

Please help me check this case. Thank you.

@dunghnguyen,
Hello. I can see the issue. It seems to be file-related, because I am unable to see correct symbols with any viewer. So, the information about expected symbols and software you use to view and create this file may be useful. You may try to read this file with options and test whether some encoding is suitable, like:
using (Aspose.CAD.Image cadImage = Aspose.CAD.Image.Load(fileName, new LoadOptions() { SpecifiedEncoding = CodePages.Japanese }))

Hi @Oleksii.Gorokhovatskyi,
Here is the view of original file and output file after converting from DXF to PDF dxf_text_bug.jpg (377.7 KB)
My question is: Is there any option to classify this case? We convert a lot of DXF file to PDF format, so if use codepage Japanese for all of the DXF file look like is not a good option. My thinking is that Aspose CAD can detect and convert the file to correct content, depend on what DXF content file look like. Is there any way to do that?
Thank you.

@dunghnguyen,
Unfortunately, there is no such a way. Reader should know the codepage. The typical way to do it is to have special DWGCODEPAGE key in the file:

9
$DWGCODEPAGE
3
ANSI_932

But it is missing in your file. So you should specify it at load. Technically you may load the file, check whether this key presents e.g. with (cadImage.Header.HeaderProperties.ContainsKey(CadHeaderAttribute.DWGCODEPAGE)), and reload the file with proper encoding again, but anyway you may face some other encoding, not Japanese. The best solution is writing proper codepage into the file, in this case everything will work automatically.

Hi @Oleksii.Gorokhovatskyi,
I got your point here. But I got another issue about output PDF file. The content of output PDF file is different between Adobe Reader and other PDF application reader. Here is DXF file, output PDF file and PNG image show the different question.zip (1.8 MB)

Can you take a look into this case? Thank you a lot.

@dunghnguyen,
yes, I can confirm that. I have logged CADNET-8647 task to fix this issue.

The issues you have found earlier (filed as CADNET-8647) have been fixed in this Aspose.CAD for .NET 22.6 update. This message was posted using Bugs notification tool by Oleksii.Gorokhovatskyi