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

Free Support Forum - aspose.com

Doc to Pdf Font and style issues

Hi I seem to have an issue with some fonts when I’m converting from doc to pdf: the font italics and bolding don’t seem to convert.

I’ve attached my test pages you can see the difference. I’m using the Myriad Pro Light true type font that is installed on my machine and it is also where I am doing the conversion.

Here is my conversion source code as well:

public static void ConvertToPDF(Stream doc, Stream result)
{
Document d = new Document(doc);
Stream xmlDoc = ConvertDocToAsposePdfXmlStream(d);

//create a new pdf!
Pdf pdf = new Pdf();

//attach the xml to it.
pdf.BindXML(xmlDoc, null);
//mark to delete images incase there were some.
pdf.IsImagesInXmlDeleteNeeded = true;

//save to the desired location.
pdf.Save(result);
}

public static Stream ConvertDocToAsposePdfXmlStream(Document doc)
{
//Save the DOC file as Aspose.Pdf.Xml in memory.
MemoryStream xmlDoc = new MemoryStream();
doc.Save(xmlDoc, Aspose.Words.SaveFormat.AsposePdf);
xmlDoc.Position = 0;
return xmlDoc;
}


Any help on this would be great!

Thanks,

Jules

hi, please disregard. I followed Embed fonts into a pdf when converting doc to pdf
and it seemed to fix my issue.

Jules