Free Support Forum - aspose.com

Fonts lost when saving to PDF

Hi , Is there any update on this issue, I'm using words v8.10 and my word document which uses the '3 of 9 Barcode' font is not embedded in to the pdf document when I use the SaveToPdf() method.

This is very urgent.

Many Thanks.

Hi Alan,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Could you please attach this font here for testing? I will check it on my side and provide you more information.

Best regards.

Hi, thanks for your prompt response.

Please find attached the barcode font that we have installed and are trying to use (all on a local pc to start with).

To test, simply create a word document with some text e.g. *123456* and set it to the barcode font.

Using aspose.words.8.10 (vb .net 1.1) After loading the doc etc, I tried two lines of code (although it's just pdf we want to save to);

doc.save(sToWordFile, saveFormat.Doc)

doc.save(sToPdfFile, saveFormat.pdf)

The word document retains the font, whereas the pdf does not and just displays the text in a normal font.

If you list the fonts inside the pdf document it does not list the barcode font.

Your help would be much appreciated.

Thanks.

Hi Alan,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for additional information. But I cannot reproduce the problem on my side. I use the latest version of Aspose.Words for testing. You can download the latest version from here:

http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/category1188.aspx

I also attached my test document and output PDF. As you can see both “Free 3 of 9 Regular” and “Free 3 of 9 Extended” fonts are embedded into the output PDF.

Best regards.

Hi,

Very odd, I even tried your document and it still doesn't work.

I'm already using the latest version of aspose.words so I'm not sure what I'm doing wrong.

Could you submit your code and I'll see if I can get that working?

Many Thanks.

Alan

Hi

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. My code is very simple just open document and save it as PDF:

// Open document.

Document doc = new Document("in.doc");

// Save output document

doc.SaveToPdf("out.pdf");

Please make sure these fonts are installed on your PC. Also, please attach your output PDF.

Best regards.

I created a new project and used your code and it worked fine, so there must be a problem with our main project, I'll try and trace the problem, but at least you proved it worked.

Many Thanks for your help.