Free Support Forum -

Issue rendering DXF file to PDF - Issue setting custom font?


I have a problem rendering the following file to PDF

This is the output file:

I am guessing I need to use a custom font, which I am trying using Arial Unicode MS
in the code below.

   String tempFileName = FileUtilities.getTempFile( ".pdf");

    // Create an instance of CadRasterizationOptions class
    CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();

    // Set the Entities type property to Entities3D.


    // Set Layouts
    rasterizationOptions.setLayouts(new String[] {  "Model" });

    // Set Graphics options

    // Create an instance of CadRasterizationOptions and set its various properties

    // Iterate over the items of CadStyleDictionary
    for (CadStyleTableObject style : (Iterable<CadStyleTableObject>)image.getStyles())
        // Set the font name
        style.setPrimaryFontName( "Arial Unicode MS");

    // Create an instance of PDF options class
    PdfOptions pdfOptions = new PdfOptions();
    pdfOptions.setVectorRasterizationOptions(rasterizationOptions);, pdfOptions);

I also enclose a copy of the font file


I guess what might be missing is an API to specify a custom folder where to load the fonts from
like the one other Aspose Products (Words, Slides, etc…) provide



Can you please share generated result along with environment detail so that we may further investigate to help you out.


This is the output file:

As you can see on the bottom left, asian text is not correctly displayed, but you can
instead see invalid characters

I am running this code on an AWS lambda image running Amazon Linux



I have worked with the file shared by you and have been able to observe the issue specified. An issue with ID CADJAVA-467 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.