Word to pdf conversion not recognizing font

Hi,

I am converting a word document which contains text formatted with the 3of9 wide true type font. The font is installed on my system and when viewing the document in word, everything is fine.

When I do the conversion however, the generated pdf contains plain text where the 3of9 wide font should have been applied.

I saved the word doc to aspose pdf xml and the text in question does seem to be annotated with the correct font


*481650-1-
$p
-
$P
*

According to the pdf documentation, I thought that as long as a true type font was installed on the system, the aspose pdf component would use it when generating the pdf?

Is there another step I need to complete to make the pdf generation use this font?

Thanks,

Stu

Dear Stu,

We have no that font. Can you please attach the font and Word document so we can test it?

Hi,

I was able to get this to work based upon the following post <A href="https://forum.aspose.com/t/129592</A></P> <P>Our document generation server has the font installed, but not the machine I was viewing the pdf on, which is why I was seeing clear text when viewing the generated pdf. I did however have to tweak the code in the post above a little bit to get the embedding to work for my font. I'm including it below so that hopefully someone can take a quick look and make sure it is not doing anything dumb and if not, then it may help someone else in the future.</P><FONT size=2> <P>Aspose.Pdf.</FONT><FONT color=#2b91af size=2>HeaderFooter</FONT><FONT size=2> hf = evenFooter ? section.EvenFooter : section.OddFooter;</P> <P></FONT><FONT color=#0000ff size=2>foreach</FONT><FONT size=2> (Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Paragraph</FONT><FONT size=2> para </FONT><FONT color=#0000ff size=2>in</FONT><FONT size=2> hf.Paragraphs)</P> <P>{</P> <P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (para </FONT><FONT color=#0000ff size=2>is</FONT><FONT size=2> Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Table</FONT><FONT size=2>)</P> <P>{</P> <P>Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Table</FONT><FONT size=2> table = (Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Table</FONT><FONT size=2>)para;</P> <P></FONT><FONT color=#0000ff size=2>foreach</FONT><FONT size=2> (Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Row</FONT><FONT size=2> row </FONT><FONT color=#0000ff size=2>in</FONT><FONT size=2> table.Rows)</P> <P>{</P> <P></FONT><FONT color=#0000ff size=2>foreach</FONT><FONT size=2> (Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Cell</FONT><FONT size=2> cell </FONT><FONT color=#0000ff size=2>in</FONT><FONT size=2> row.Cells)</P> <P>{</P> <P></FONT><FONT color=#0000ff size=2>foreach</FONT><FONT size=2> (Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Paragraph</FONT><FONT size=2> cellpara </FONT><FONT color=#0000ff size=2>in</FONT><FONT size=2> cell.Paragraphs)</P> <P>{</P> <P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (cellpara </FONT><FONT color=#0000ff size=2>is</FONT><FONT size=2> Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Text</FONT><FONT size=2>)</P> <P>{</P> <P>Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Text</FONT><FONT size=2> text = (Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Text</FONT><FONT size=2>)cellpara;</P> <P></FONT><FONT color=#0000ff size=2>foreach</FONT><FONT size=2> (Aspose.Pdf.</FONT><FONT color=#2b91af size=2>Segment</FONT><FONT size=2> seg </FONT><FONT color=#0000ff size=2>in</FONT><FONT size=2> text.Segments)</P> <P>{</P> <P></FONT><FONT color=#0000ff size=2>if</FONT><FONT size=2> (seg.TextInfo.FontName.Equals(</FONT><FONT color=#a31515 size=2>"Code39 Wide"))

{

seg.TextInfo.IsFontEmbedded = true;

}

}

}

}

}

}

}

}

Thanks,

Stu