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

Free Support Forum - aspose.com

Embedding fonts in PDF

Hi!

I try to convert a word(ML) document to a pdf document and have problems embedding the used fonts into the pdf.

I followed the instructions on http://www.aspose.com/documentation/file-format-components/aspose.pdf-for-.net-and-java/fonts-embedding-while-creating-pdf.html, but I was not successful.

I am using the following code for the convertion:

//create pdf from wordML
Aspose.Words.Document wordDocument = new Document(memStream);
wordDocument.UpdateFields();

Aspose.Pdf.Pdf pdfDocument = new Pdf();

MemoryStream tempDocStream = new MemoryStream();
wordDocument.Save(tempDocStream, SaveFormat.AsposePdf);
wordDocument.Save(“D:\scriptpdf.xml”, SaveFormat.AsposePdf);

pdfDocument.BindXML(tempDocStream, null);
pdfDocument.SetUnicode();

pdfDocument.Save(targetFilename);
tempResult.Close();

The scriptpdf.xml contains the following information:

<?xml version="1.0" encoding="UTF-8"?>



Script




If I only use the word generation, the document looks right. But in the pdf I only see a standard font instead the script font. What do I wrong?

Thanks for the help.

Hi,

Can you please share the word document with us, so we could investigate the issue at our end?

We really appreciate your cooperation.

Regards,

Thanks for the reply. I have put the wordML into the attachment. This is the content of the memory stream (memStream) parsed by Aspose.Word.

But the generated aspose.pdf xml seems to have the information about the font. The problem is that the font will not be displayed in the pdf (not embedded?).

Hi,

I’ve tested the issue and I am able to notice the problem. We are looking into the details of this matter and will keep you updated with the status of correction.

We apologize for your inconvenience.

Hi.

Can you please give me an update of solving this problem. We have a project that finishes at the end of this month and we would like to solve this issue in this time.

Kind regards,

Hi,

I’ve contacted the development team to share the ETA for the resolution of this problem and soon you will be updated with the status of resolution. Your patience in this regard is highly appreciated.

Hi,

I am a developer of aspose pdf team. I have checked the issue. In my investigation, the font 'Bickham Script Pro Regular' is not supported. It is an OTF font. At present, OTF fonts are not supported well in Aspose.Pdf. We consider improve it in our future release. However, I am afraid we can't finish it in short time. Sorry for inconvenience.

P.S. In order to embed fonts into the pdf file, please add the following codes before Pdf.Save() method:

pdf.TextInfo.IsFontEmbedded = true;


Best regards.

Thanks for the answer.