DWG to PDF char encode on export


#1

So, I’m trying to export a DWG to PDF and all looks good. Though, some special characters are not rendered accordly. Is there a way to set the char encoding on the result PDF output?

Here my code:

private ResponseEntity<byte[]> dwgToPdf(byte[] bytes) {

    val stream = new MemoryStream(bytes);

    val image = Image.load(stream.toInputStream());

    CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions();
    rasterizationOptions.setBackgroundColor(Color.getWhite());
    rasterizationOptions.setPageWidth(1600);
    rasterizationOptions.setPageHeight(1200);

    // Create an instance of PdfOptions
    PdfOptions pdfOptions = new PdfOptions();
    // Set the VectorRasterizationOptions property
    pdfOptions.setVectorRasterizationOptions(rasterizationOptions);

    // Export the DWG to PDF

    val os = new ByteArrayOutputStream();

    image.save(os, pdfOptions);

    return ResponseEntity.ok(os.toByteArray());

}

#2

@jairoandre,

I have observed your comments. Can you please share source file along with environment details and also please share which Aspose.CAD version you are using on your end so that we may further investigate to help you out.