We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Unreadable fonts in browser when converting DOCX to PDF

I'm currently experiencing a strange issue when converting a docx file, which uses different fonts, into pdf using DocIORenderer.

I'm loading the docx file into a WordDocument, and then converting it with

using (var renderer = new DocIORenderer())
using (var file = File.OpenWrite("c:\test\converted.pdf"))
{
    PdfDocument pdf = renderer.ConvertToPDF(Document);
    pdf.Save(file);
}

When viewed inside Acrobat Reader, the document is rendered correctly (see attached image "acrobat.png").

When the same pdf is viewed inside Chrome (version 70.0.3538.102) or Firefox (version 60.0.3) fonts are not even readable, and rendered totally wrong (see attached images "chrome.png" and "firefox.png").

This behavior truly limits fonts used inside pdf.

I've also attached both the pdf and the original docx file used for the tests.



Attachment: pdf_issue_c0d78dc4.zip

3 Replies

DB Dilli Babu Nandha Gopal Syncfusion Team November 23, 2018 07:06 AM UTC

Hi Federico, 

Greetings from Syncfusion. 

We can reproduce the reported issue from our side. This issue has been fixed recently and the issue fix will be included in our upcoming main release 2018 Volume 4. The release is estimated to be rolled out by December 2018 and we will let you know once it is released. So, we recommend you to upgrade to 2018 Volume 4 Essential version which will resolve this issue. 

Regards, 
Dilli babu. 



FD Federico Dipuma replied to Dilli Babu Nandha Gopal December 14, 2018 03:20 PM UTC

Hi Federico, 

Greetings from Syncfusion. 

We can reproduce the reported issue from our side. This issue has been fixed recently and the issue fix will be included in our upcoming main release 2018 Volume 4. The release is estimated to be rolled out by December 2018 and we will let you know once it is released. So, we recommend you to upgrade to 2018 Volume 4 Essential version which will resolve this issue. 

Regards, 
Dilli babu. 


Hi Dilli babu,
I ran a few tests using the version 16.4.0.40-beta (which is already available on nuget), but I've still got problems in viewing PDF files in operating systems other than Windows.

Fonts rendering is wrong on Mac or Linux (which includes android), as you can see in attachment.

Will this issue be resolved with the final release? This is very problematic for many of our customers not using Windows OS.

Thanks,

Attachment: test_64d9d3db.zip


DB Dilli Babu Nandha Gopal Syncfusion Team December 18, 2018 05:46 PM UTC

Hi Federico, 

Greeting from Syncfusion. 

On further analyzing in depth with the reported problem, we suspect that the font used in generated PDF are not available in another machine (MAC and Linux). So, it doesn’t preserve properly while opening PDF in that particular environment (like safari browser in MAC). To resolve this problem, we suggest you to embed the fonts into PDF while converting the Word document into PDF using EmbedFonts and EmbedCompleteFonts API.

Please refer the below UG documentation link to embed fonts in the PDF document while performing Word to PDF conversion:
https://help.syncfusion.com/file-formats/docio/word-to-pdf#embedding-fonts
 

Regards, 
Dilli babu. 


Loader.
Live Chat Icon For mobile
Up arrow icon