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

Free Support Forum - aspose.com

Converting word with embedded chart to PDF cause generation failure

error: “Cannot invoke “com.aspose.words.zzYs3.getFormatCode()” because the return value of “com.aspose.words.zzqI.zzYHQ()” is null”
when I try to convert this attached word to pdf the generation failembed testing (4).docx (52.9 KB)

@operationsdotbcs I cannot reproduce the problem using the latest 23.1 version of Aspose.Words for Java. I have used the following simple code for testing:

Document doc = new Document("C:\\Temp\\in.docx");

Hi, I updated the version of Aspose Words to version 23.2. As a result, I was able to successfully convert to PDF. However, the output is not identical to the original. I attached the word and the converted pdf
and this is the code:
0680600000PdOluAAF.pdf (185.3 KB)
embed chart.docx (52.9 KB)

String dataDir = Utils.getDataDir();
String filePath = dataDir.concat(fileId).concat(".").concat(extension);
Document doc = new Document(filePath);
dataDir = dataDir.concat(fileId.split("\\.")[0]).concat(".pdf");

PdfSaveOptions options = new PdfSaveOptions();
    .setFontsFolders(new String[] { FONTS_PATH, "/usr/share/fonts/" }, true);

doc.save(dataDir, options);

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): WORDSNET-25128

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.