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

Free Support Forum - aspose.com

Arial Bold not rendered correctly in PDF

Hi all,

Just wondering if someone can help me with a problem.

Please see sample code below:

public class MyTest {

public static void main(String[] args) throws Exception{
License license = new License();

license.setLicense(“C:\Temp\Aspose.Words.lic”);

String src = “C:\Temp\1111.docx”;

String dst3 = “C:\Temp\2.pdf”;
com.aspose.words.Document doc = new com.aspose.words.Document(src);


FontSettings.setFontsFolder(“C:\Windows\Fonts\”, false);
doc.save(dst3);
}

}

I have attached the 1111.docx. I am using the latest Aspose.Word 10.0.1 and Windows 7.

The problem is the generated PDF doesn’t display the font in Arial Bold. I have also attached the generated PDF file.

Could you please let me know how to fix this?

Thank you so much!

Hello

Thanks for your request. I suppose you mean “Arial Italic”?

Please make sure that “Arial Italic” font is installed on the PC where you perform conversion to PDF. If not, please try to install this font. This should fix the problem. Please let me know in case of any issues.

Best regards,

Hi Andrey,

Thanks for your quick response.

I actually have problem with both Arial Bold and Arial Italic fonts, both are missing from the generated PDF document.

Just wondering are these fonts not coming with Windows 7? I think I can see it with Windows Explorer. Please see the attached screenshot.

I tried to change the second parameter to true, but the problem is still there.

FontSettings.setFontsFolder(“C:\Windows\Fonts\”, true);

Could you please help?

Thanks a lot!

Hi

Thank you for additional information. The problem is that MS Word does not actually use Arial Italic font in this case. If you open the font, you will see that glyphs are absolutely different.

It seems for some reason MS Word uses Segoe Script font. I not sure why MS Word uses such a strange substitution rule because “Arial Italic” does not look as “Segoe Script”.

If you set Segoe Script font explicitly, the document will be rendered as expected.

Best regards,

Thanks Alexey.

But I am not quite understand. Just wondering is there any way to solve this problem? And if it’s not possible to render Arial Bold and Arial Italic fonts correctly when saving as PDF, then is there a quick way to changes the fonts used in a document? I don’t want to manually change the fonts in the document. The fonts have been used in many places, change them manually will be time consuming.

Thanks again.

Just found out it’s easy to replace fonts in Word. However it’s still better if the problem can be fixed directly.

Hi

Thanks for your request. You can use the similar approach as suggested here to change font in the document:

http://www.aspose.com/community/forums/162416/change-font/showthread.aspx#162416

I am not sure we have to fix something here, because if take a look at Arial Italic and Segoe Script fonts, you can definitely conclude that substitution rule used by MS Word is incorrect.

Best regards,

Thank you so much! The FontChanger helped! I replaced all Arial Bold to Arial with Bold style and Arial Italic to Arial with Italic style. And it worked!

Hi Gregory,

It is perfect that you managed to resolve the problem. Please let us know if you need more assistance, we are always glad to help you.

Best regards,