We have word template file which contains normal text with standard font and in header there is a barcode which is actually a font called Archon Code 39. Unfortunately after converting doc to pdf the barcode is not generated. How can we include this font to make pdf read this part of document correctly?
AVAbirami Varadharajan Syncfusion Team April 8, 2019 07:33 AM
We suggest you to apply complete embed font to resolve issue at your end. We have a behaviour to embed font for the Unicode character and we will use ANSI Encoding for Non-Unicode character to reduce file size for normal character.
So kindly apply below code before converting the document to resolve issue.
DocIORenderer docIoRenderer = new DocIORenderer();
docIoRenderer.Settings.EmbedCompleteFonts = true;
For more details, please find the attached sample, in which we have created a word document with font “Archon Code 39” and converted the word document to PDF document.
Please let us know if you have any concerns.
SKSzymon KozlowskiApril 9, 2019 03:30 AM
Hi! Thank you for quick response and very nice sample. I want to use it in Azure Webjob and I use your code with small diffrence - I load the file from base64 string instead of FileStream and it is not working.. can you give me some more insights on this ? I include code below:
AVAbirami Varadharajan Syncfusion Team April 12, 2019 01:08 AM
We are analyzing on the issue in azure environment. We will update you with further details on 15th April 2019. Alternatively, we suggest you the below approaches to achieve your requirement.
Embed the fonts in Word document using Microsoft Word application and convert into PDF.
Please refer the below steps to meet your requirement:
1. Open the Word document using Microsoft Word application and embedded the fonts in the document as per below screenshot: In Microsoft Word application, go to File-> Options -> Save -> Check “Embed fonts in the file” option.
Thus, the fonts used in the Word document are embedded into the file and moved along with the file to another machine. Essential DocIO provided support to preserve embedded fonts from the Word document into PDF while performing Word to PDF conversion from our 2018 Volume 4 release (188.8.131.52).
If the font used in the Word document is missing in production machine, then DocIO uses “Microsoft Sans Serif” as default font for rendering the text in Word to PDF conversion.
From 2018 Volume 1 release (v184.108.40.206) onwards, DocIO provides support to customize font substitution using event while converting a Word document as PDF. Please find the linked sample, in which we have used font substitution feature which will helpful to achieve your requirement.
Please let us know if you need further queries.
AVAbirami Varadharajan Syncfusion Team April 15, 2019 06:23 AM
On our further analysis, we have confirmed that the issue occurs when the specified font is not available in Azure environment. We have also ensured the same in windows environment. As mentioned in the previous update, we kindly request you to make use of the below approaches to achieve your requirement.
Embed font in the input document
MSMatt SymesOctober 22, 2019 02:10 PM
We have the same issue. Is there any way we can deploy the fonts to a folder and have the Word->PDF Converter know to look in that folder for additional fonts for embedding? If this isn't available as a feature now, can it be considered for your roadmap please.
VAVijayasurya Anandhan Syncfusion Team October 23, 2019 07:59 AM
In this sample, we have done the following things: 1. Set the customer folder path to load the font stream. 2. Loaded the existing Word document. 3. Initializes the SubstituteFont event to perform font substitution during Word to PDF conversion. 4. Convert the Word document to PDF.