Hi,
we have an issue when converting a docx to PDF looks different from the word document (and also different compared to a PDF generated with MS Word).
Reproducable simply with
var doc = new Document(@"S:\tmp\in_anonymized.docx");
doc.Save(@"S:\tmp\out_anonymized.pdf");
out_anonymized.pdf (53.2 KB)
in_anonymized.docx (33.8 KB)
out_word.pdf (378.1 KB)
Thanks for your help
Daniel
Edit: We reproduced this with net10 and win 11
@Serraniel The problem is not reproducible on my side. However, the Frutiger LT 45 Light font used in your document is not available on my side. Could you please attach this font here for testing?
Usually, the such problems occur because the fonts used in your input document are not available on the machine where document is converted to PDF. The fonts are required to build document layout. If Aspose.Words cannot find the font used in the document, the font is substituted . This might lead into fonts mismatch and document layout differences due to the different fonts metrics. You can implement IWarningCallback to get notifications when font substitution is performed.
Please see our documentation to learn where Aspose.Words looks for fonts:
https://docs.aspose.com/words/net/specifying-truetype-fonts-location/
Hi,
thanks for your response. I haven’t checked fonts before tbh. I attached a txt file with all my Fonts from C:\Windows\Fonts, for my reproduction I did not use any custom font sources / directories, so I assume only system fonts have been used.
Frutiger is not installed on my system (and I think also not in our environment where our customer documents are processed).
Question: My local word still managed to generate a PDF which at least looks the same as the document in Word, with the installed fonts. So it looks like Office uses different Font substitution rules than Aspose? Is this still not a wrong PDF by Aspose.Words then, if the target is to mimic word behaviour?
I checked PDF by Word and what Fonts are used:
- Aptos
- Arial (BoldMT, MT)
- Calibri (“normal”, Bold, BoldItalic, Italic)
- SymbolMT
- TimesNewRomanPSMT
So my point is, that with the Font missing, the PDF by aspose still is different than what Word does.
installed-fonts.zip (2.0 KB)
Thanks for your help,
Daniel
@Serraniel Do you convert the document using Aspose.Words in the same environment where you convert document to PDF using MS Word?
Also, Aptos is a cloud font, so it is not installed by default and is downloaded by MS Word on demand. Aspose.Words does not download cloud fonts. You can manually download Aptos fonts from here.