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

Free Support Forum - aspose.com

Conversion from docx to pdf produces unreadable text

Hi,


We are currently evaluating Aspose.Words for use in a module for generating reports, targeting both Linux and Windows (we are currently testing on Linux (Ubuntu 11)).

I’m trying to test simple DOCX-to-PDF conversion, but I’m running into an odd issue; while the Word document’s formatting seems to be replicated, the actual text uses a different, unintelligible font. I have attached an example of a very simple input document and its output. The input document was created in Word 2007, if it matters.

This is the code I’m using to do the conversion:
public void convert(InputStream in, OutputStream out) throws Exception {
Document doc=new Document(in);
doc.save(out,SaveFormat.PDF);
}

Any ideas on what could be causing this?

Hi Wes,


Thanks for your inquiry.

Aspose.Words requires TrueType fonts when rendering documents to fixed-page formats (e.g. PDF, XPS or SWF). Most likely this problem occurs when you use Aspose.Words on Linux or Mac OS or your MS Word document uses fonts that are not present on your computer or Aspose.Words cannot locate fonts on your computer. If any of these is found to be the case, you can either copy True Type font files from a Windows machine or install a True Type font package on your machine. Also, you can use the FontSettings class to specify the location of the font files.

Moreover, you can also try embedding fonts into the resulting PDF documents by using PdfSaveOptions.setEmbedFullFonts(booleanvalue).

Please let us know if you need more information, we are always glad to help you.

Best Regards,

Installing the MS Core Fonts package (msttcorefonts on Ubuntu) fixed the problem. Thanks for the help!

Hi Wes,


Thanks for your feedback. It is perfect that you managed to resolve the problem on your side. Please let us know any time you have any further queries.

Best Regards,