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

Embedding Fonts in DOC to PDF conversion

Hi, I am using Syncfusion.DocToPDFConverter.DocToPDFConverter class to convert a Word document (DOC or DOCX) to PDF.

There is the ability to generate a PDF document with embedded fonts (that was used in Word document)?

15 Replies

KC Karthikeyan Chandrasekar Syncfusion Team August 1, 2013 04:45 AM UTC

Hi Claudio,

Thank you for your interest in Syncfusion Products.

 

At present we do not have support for Embedding Font during Doc to PDF conversion.

We have already created a Feature Request “Need to embed font in PDF during Doc to PDF conversion”.

We will let you know once the feature is implemented.

 

Please let us know if you have any concern.

 

Thanks,

Karthikeyan.C



MA Marta June 10, 2015 07:18 AM UTC

Hi!

I have de same problem: 

Hi, I am using Syncfusion.DocToPDFConverter.DocToPDFConverter class to convert a Word document (DOC or DOCX) to PDF.

There is the ability to generate a PDF document with embedded fonts (that was used in Word document)?

Thank you!




KK Karthik Krishnaraj Syncfusion Team June 11, 2015 09:04 AM UTC

Hi Marta,
Thank you for using Syncfusion products,
As we mentioned earlier we don’t have support for “Embedding Font during Doc to PDF conversion.”, whereas as a workaround you can able to achieve this, for this you need to create a pdf document with PdfA1b standard. I have attached a code snippet for your reference please check through it and let us know if there is any concerns.
Code snippet:

WordDocument wordDoc = new WordDocument("wordDocument.doc");

DocToPDFConverter converter = new DocToPDFConverter();

//Creates a new document with PDF/A standard.

PdfDocument pdfDoc = new PdfDocument(PdfConformanceLevel.Pdf_A1B);

pdfDoc = converter.ConvertToPDF(wordDoc);

pdfDoc.Save("Sample.pdf");
pdfDoc.Close();
Thanks,
Karthik.



MA Marta June 11, 2015 11:39 AM UTC

Hello Karthik

I have tried to text your code snippet but the font doesn´t change

This is my code snippet:


  private byte[] PasarAPdf(WordDocument doc)
  {
            var converter = new DocToPDFConverter();
            PdfDocument pdfDoc = new PdfDocument(PdfConformanceLevel.Pdf_A1B);
            pdfDoc = converter.ConvertToPDF(doc);        
            pdfDoc.DocumentInformation.Author = "SGTIC"; 
            pdfDoc.FileStructure.Version = PdfVersion.Version1_7;        
            var stream = new MemoryStream();      
            pdfDoc.Save(stream);
            return ConvertirStreamToBytes(stream);
        }

Thank you!


KK Karthik Krishnaraj Syncfusion Team June 12, 2015 06:19 AM UTC

Hi Marta,
We couldn’t able to reproduce the issue with “Font doesn’t change while embedding fonts in doc to pdf”, I have attached a screen shoot and output pdf document in which all the fonts are embedded. Can you please provide us the input document for which the issue occurs so that we can investigate further in this, please let us know if you have any concerns.
Sample Link:
http://www.syncfusion.com/downloads/support/forum/110376/ze/Report_document-286978616
Thanks,
Karthik.


MA Marta June 12, 2015 07:31 AM UTC

Hi!

I send you the template word document and the generated PDF document. The family fonts of the template word document are Calibri and Bell MT and the font of the pdf document is only Calibri


Thank you!

Attachment: issue_embedding_fonts_doc_to_pdf_cb812284.zip


SV Sivasubramani V Syncfusion Team June 15, 2015 11:03 AM UTC

Hi Marta,

We were able to reproduce the problem and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let me know if you have any questions.

Regards,
Sivasubramani



JG Jani Giannoudis July 19, 2016 12:57 PM UTC

Hi

Same Problem here.

Your example didn't work for me.

PdfDocument pdfDoc = new PdfDocument(PdfConformanceLevel.Pdf_A1B);
pdfDoc = converter.ConvertToPDF(wordDoc);

I think the
ConvertToPDF call will replace the pdfDoc created with the PdfA1b Format.
Do you have a working example, with the conversion to a PdfAib file?

Cheers
Jani Giannoudis



KK Karthik Krishnaraj Syncfusion Team July 20, 2016 10:30 AM UTC

Hi Jani, 
I have attached a simple sample to embed fonts in DOC to PDF conversion, kindly check through it and let me know if you have any concerns. 
Sample Link: 
Thanks, 
Karthik 



JG Jani Giannoudis July 20, 2016 12:42 PM UTC

Hi Karthik

Thanks for the working example.

However, there seems to be a state within the Syncfusion library with the PDF Conformance Level.
It would be much clearer, adding the PdfConformanceLevel to the DocToPDFConverterSettings class.

Thanks again
Jani



VR Vijay Ramachandran Syncfusion Team July 21, 2016 06:40 AM UTC

Hi Jani,

Thank you for your update.

DocToPDFConverterSettings class also have API for setting the PDFConformancelevel to embed the fonts in Word to PDF conversion. We have modified the sample by setting the PDFConformancelevel using DocToPDFConverterSettings class API. Please find the modified sample from the following link:

http://www.syncfusion.com/downloads/support/forum/110376/ze/EmbedFont_Modified_Sample-1803632859.zip

Let us know if you have any concern.

Regards,
Vijay R



SI Samuel Iseli July 21, 2016 08:28 AM UTC

Hi Vija

Seems to be new in Essential Studio File Formats v14. Property is available after upgrading from v13 to v14.

Thanks for the great support!

Cheers
Jani



VR Vijay Ramachandran Syncfusion Team July 22, 2016 04:25 AM UTC

Hi Jani,

Thank you for your feedback.

Regards,
Vijay R
 



RK Roman Killingseder replied to Vijay Ramachandran October 24, 2016 09:12 AM UTC

Hi Jani,

Thank you for your feedback.

Regards,
Vijay R
 


Hi,
I got the same problem unable to extract the embedded font from the pdf file.
I use Syncfusion.DocToPDFConverter and tried the given solution PdfConformanceLevel.Pdf_A1B;

Is there a working solution for this Problem?

Thank you!


KK Karthik Krishnaraj Syncfusion Team October 25, 2016 10:25 AM UTC

Hi Roman, 
I have attached a simple sample to extract the embedded font from PDF file, kindly check it and let us know whether it meets your requirement. 
Example: 
PdfLoadedDocument ldoc = new PdfLoadedDocument(stream); 
//Extracts the fonts from PDF file. 
PdfUsedFont[] fonts= ldoc.UsedFonts; 
Sample Link: 
Thanks, 
Karthik. 


Loader.
Live Chat Icon For mobile
Up arrow icon