Embedded fonts lost when saving to PDF

Hi

Yes, you are right, Aspose.Words cannot read fonts embedded into Word documents. However, fonts installed on your PC can be embedded into the resulting PDF document.

Best regards.

Thanks for your reply Alexy, but I am not any closer to a working solution.

I have tried using Aspose.Words 6.3.0 and 6.4.0.

Version 6.4.0 simply times out. It never returns from methods called on the Document object (including save(), savetopdf(), and even accessing attributes such as PageCount). Is this a known problem ? I have seen one other post where someone reported something similar.

Setting the attributes as suggested in your example did not embed the fonts in the PDF document. I could also confirm this from the PDF properties in Adobe Reader. None of the non-standard fonts in the original word document were reported as being used in the PDF.

The fonts are installed on the machine where the conversion is taking place, which is also where the PDF is being viewed.

Hi

Thanks for your inquiry. Could you please attach the document that causes the problems? Also, you can attach fonts, which are used in your document.

I will check them on my side and provide you more information.

Best regards.

Attached is the word document generated by the server application before conversion to PDF.
Also attached is a zip file containing the fonts used.
Please note these are licensed fonts. Also, the word document is produced from a “template” which is created and maintained by the system admin. Data is merged into the template from a database. The application (on the server) does not “know” which fonts will be used in what part of the document, so the font can not be set dynamically at run time.

Thanks and Regards,
Andrew

Hi

Thank you for additional information. For some reason, I cannot convert your document to PDF. Aspose.Words just eats 100% of CPU and never finishes conversion. I will notify you as soon as this problem is fixed.

Best regards.

I am also having an issue with Words saving as PDF with embedded fonts that are lost.

I have tried a number of differnt options found in your forums and nothing seems to work.

I have tried the code lsited below with every possible combination in between, skipping lines etc. and checking each file before and after the save and nothing seems to work. The font I am using is: IDAutomationHC39S. Attached is the font and test.doc that I am using.

I am currently using the latest version of Aspose.NET.Total, so any solution involving all your products would be great.

Here is thesample code.

Document doc = new Document("test.doc");
Aspose.Words.Rendering.PdfOptions pdfOptions = new Aspose.Words.Rendering.PdfOptions();
pdfOptions.IsEmbedTrueTypeFontsForAsciiChars = true;
doc.SaveToPdf(0, doc.PageCount, "test.pdf", pdfOptions);
// Save the doc in a xml file that can be handled by Aspose.Pdf.
doc.Save("test.xml", SaveFormat.AsposePdf);
doc.Save("test.pdf", SaveFormat.Pdf);
doc.Save("test.pdf");
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML("test.xml", null);
pdf.SetUnicode();
pdf.TextInfo.IsFontEmbedded = true;
pdf.IsAutoFontAdjusted = true;
pdf.IsTruetypeFontMapCached = true;
pdf.TruetypeFontMapPath = Path.GetTempPath();
pdf.Save("test.pdf");

Please Help as this is a big issue for our release.

Thanks

Graham Marko

I’ve got a very simple document, 1 line of text, using Inconsolata (a free font), and the latest total.net – doc.SaveToPDF() fails to embed the font in the document. It’s an OTF. If I save the word document to another location, or clone it, the font is still used, but not in the PDF.

This code actually worked:

Document doc = new Document("test.doc");
doc.Save("test.xml", SaveFormat.AsposePdf);
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
pdf.BindXML("test.xml", null);
pdf.SetUnicode();
pdf.TextInfo.IsFontEmbedded = true;
pdf.Save("test.pdf");

Hi

Graham, Thank you for additional information. Using the latest version of Aspose.Words (6.5.0), which was release few hours ago, I can successfully convert your document to PDF. I can see, the following fonts are using in your document:

Times New Roman
Futura Std Condensed Light
Futura Std ExtraBold
Futura Std Book
Verdana
Tahoma
Arial Narrow
Futura LT CondensedBold

I highlighted fonts that were not embedded. But they were not embedded because such fonts are not installed. I cannot find these fonts in the archive you have attached. So, please make sure the fonts are installed.

Mark, please attach your document and font here for testing. I will check your issue and provide you more information.

Best regards.

Thanks Alexey - that is the same problem I see using Words 6.4.0

It is not just saving/converting that causes it to eat CPU and not finished. Even accessing the value of an attribute (Eg. PageCount) will cause this to happen.

I have had to resort to using the legacy method of saving as AsposePDF (XML), binding to that, and then loading it into a Pdf object. I had been doing that using Words 5.2.2 !!

This font is licensed by our customer, and being able to use it is a critical issue for their compliance and marketing people.

Hi Andrew,

Thank you for additional information. Conversion to PDF works fine with the latest version of Aspose.Words (6.5.0). You can download it from here:

Also, please attach your document here for testing.

Best regards.

Thanks Alexey.

I have had to download a temporary license for 6.5.0 (our subscription just missed it, but I will be renewing in the next few days).
I was able to use 6.5.0 with the temporary license OK, but I still don’t see the embedded fonts in the PDF document.
I have attached the sample document again FYI. Can you confirm you can embed the fonts in the generated PDF and attach the pdf please ?

Hi Andrew,

Thanks for your request. Please attach also the following fonts:

  • Futura Std Condensed Light
  • Futura Std ExtraBold
  • Futura Std Book
  • Futura LT CondensedBold

Best regards.

Hi Alexey.

These were in a file I attached previously, but I have attached them again as requested.

Cheers,
Andrew

Hi

Thank you for additional information. I managed to reproduce the problem with Futura Std fonts. You will be notified as soon as the problem is resolved.

Best regards

G’day Alexey,

has there been any progress on this issue ? Will Aspose notify me through the forum (i.e. do I need to keep checking back here) or will you notify me directly ?

I need to make a decision about renewing our subscription and using Aspose for this project/customer ASAP.

Regards,
Andrew

Hi

Thanks for your request. The issue is unresolved yet. The notification will be posted here in this forum thread once the issue is resolved. You can enable email subscription from this forum thread, and you will get notification, when something new is posted in this thread.

Best regards.

The issues you have found earlier (filed as 9542) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(15)

A fix for the issue(s) you've reported (filed as 7626) will be released in the next release at the end of this month. You will be notified.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(4)

The issues you have found earlier (filed as WORDSNET-2103) have been fixed in this .NET update and in this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(86)