Hello,
I’m using Aspose.Words for Java on Mac OS X (running Lion 10.7.3). I’m finding that whenever I try to convert a file to PDF format, no fonts are embedded. Or, at least, very few are - for the most part, only the standard fonts ever get embedded - Times New Roman, Arial and Courier. Sometimes other fonts get embedded, but it seems completely random.
I’ve attached two files to show what I mean. The original .docx file (fontstest.docx) contains several fonts - Helvetica Neue, Courier New, Garamond, Didot, Myriad Pro Condensed, Cochin and Futura.
The PDF file (fontstest.pdf) was converted from the .docx file using Aspose.words. As soon as you open it, you will see that the fonts are completely wrong - most of the document is in Times New Roman, even though not a single character of the original used Times New Roman. According to File > Properties in Adobe Acrobat, the embedded files are Courier New, Myriad Pro and Times New Roman. All of the other fonts - Helvetica Neue, Garamond, Didot, Cochin and Futura - have been completely discarded. (In another test document, Myriad Pro was discarded, yet it’s included here - so it seems that there is definitely a bug making things act erratically.)
Both of these files were created on the same machine (that is, the PDF file was converted on the same machine on which the .docx file was created), with all of these fonts on the system the PDF was created on. What’s going on here? The code I’m using is straightforward:
Document doc = new Document(inputPath);
doc.updateFields();
doc.save(outputPath);
I’ve also tried:
Document doc = new Document(inputPath);
doc.updateFields();
PdfSaveOptions options = new PdfSaveOptions();
options.setEmbedFullFonts(true);
doc.save(outputPath, options);
But this makes no difference whatsoever. I’ve also tried setting the fonts folder using FontSettings, but with no joy (and besides, it is clearly embedding some of the fonts and not others, even though they are all in the system fonts folder).
What gives? I’ve tried converting a range of files - RTF files, .doc files, .docx files, .odt files - and get the same result every time: the fonts in the PDF file are always completely messed up, mostly missing. I’m going to have a lot of angry users if I ship using the Aspose converters without resolving this…
Many thanks for your help!
All the best,
Keith