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.
Unfortunately, activation email could not send to your email. Please try again.

Strange Font Problem When Doc To PDF

Thread ID:

Created:

Updated:

Platform:

Replies:

124321 May 31,2016 01:17 PM Aug 17,2017 08:22 AM ASP.NET Web Forms (Classic) 5
loading
Tags: DocIO
Emre
Asked On May 31, 2016 01:17 PM

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

Vijay Ramachandran [Syncfusion]
Replied On June 1, 2016 06:15 AM

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


Emre
Replied On June 1, 2016 04:45 PM

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?

Vijay Ramachandran [Syncfusion]
Replied On June 2, 2016 03:02 AM

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
 


Paul Steiner
Replied On August 16, 2017 07:29 AM

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.


Vijay Ramachandran [Syncfusion]
Replied On August 17, 2017 08:22 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;