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

Strange Font Problem When Doc To PDF

Updated on May 31, 2016 10:07 AM
Hi,

I'm in a deep research to find a good word to pdf converter in c#.
I try to upload my word document to your online tool (DocToPDF) and try to convert it to PDF. But a strange font behavior occured, when I open PDF in an android device. My word document has a 3 lines of text in Verdana font. I emailed PDF to my email address and used Google Drive PDF Viewer to open PDF document. But some suqare characters occured on the viewer. I attached my docx file as attachment. What is the problem? If I change my font to Arial it works great. But I need to use Verdana....

Attachment: my_doc_cdef517d.rar

5 Replies

VR Vijay Ramachandran Syncfusion Team June 1, 2016 10:15 AM UTC

Hi Emre,

Thank you for using Syncfusion product.

Currently DocIO doesn’t embed the fonts while converting Word document as PDF by default. For embedding the fonts, you need to pass parameter PDFConformanceLevel.Pdf_A1B while creating the PDFDocument object. We have also prepared the sample to embed the font while converting Word document as PDF. Please find the sample from the following link and let us know if it helps.
http://www.syncfusion.com/downloads/support/forum/124321/ze/GenerateWord_Console2139276883.zip

Also we have attached PDF file which is generated by using the above sample. Please find the output PDF file from following link:
http://www.syncfusion.com/downloads/support/forum/124321/ze/DocIO_Result1629652450.zip

Regards,
Vijay R



EM Emre June 1, 2016 08:45 PM UTC

Thank you,

I understand. Examples are enough for me. 
Why don't you support to embed fonts when converting from Word to PDF? 
Do you plan to add this functionality in the future?


VR Vijay Ramachandran Syncfusion Team June 2, 2016 07:02 AM UTC

Hi Emre,

Thank you for your update.

 
Why don't you support to embed fonts when converting from Word to PDF? 
PDF file size will get increased While embedding the fonts by comparing with non-embedded documents. So that we are not embedding the fonts in the PDF file during Word to PDF conversion by default. 
Do you plan to add this functionality in the future? 
We will consider your requirement and will provide option in our Word to PDF online demo sample to set PDFConformanceLevel in any of our upcoming releases. 

Regards,
Vijay R
 



PS Paul Steiner August 16, 2017 11:29 AM UTC

I don't think that example works.

PdfDocument pdfDocument = new PdfDocument(PdfConformanceLevel.Pdf_A1B);

pdfDocument = converter.ConvertToPDF(wordDocument);

The pdf document created on the first line gets destroyed on the second line, because an new object is assignet. To pass the parameter is useless.



VR Vijay Ramachandran Syncfusion Team August 17, 2017 12:22 PM UTC

Hi Paul,

Thank you for contacting Syncfusion support.

We have ensured our sample and it works fine, i.e. the generated PDF document conformance level is set as Pdf_A1B.

As per your illustration, we are creating new object(PdfDocument) while calling DocToPDFConverter.ConvertToPDF() method. We have internally maintained the PdfConformance level property as static, so that the conformance level property was not reset even though if we create new object during Word to PDF conversion.

Since the created PDF object is not used in Word to PDF conversion, we recommend you to use below code snippets to set the pdf conformance level.
 
            WordDocument document = new WordDocument(FileName);
           
DocToPDFConverter converter = new DocToPDFConverter();
           
//Set the PDF Conformance level.
            converter.Settings.PdfConformanceLevel = PdfConformanceLevel.Pdf_A1B;
           
PdfDocument pdf = converter.ConvertToPDF(document);
            pdf.Save(FileLocation);
            document.Close();
            pdf.Close(
true); 

Please let us know if you have any questions.

Regards,
Vijay R


Loader.
Up arrow icon