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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

What might be the reason for a font not embedding correctly?

Thread ID:

Created:

Updated:

Platform:

Replies:

144521 May 9,2019 11:19 AM UTC May 28,2019 02:59 PM UTC ASP.NET Core - EJ 2 3
loading
Tags: DocIO
Paul Kocher
Asked On May 10, 2019 08:29 AM UTC

I'm using DocIO/PDF with version 17.1.0.44 and have problems embedding a font in a PDF document which I converted using DocIORenderer.

You can find the font attached below - here is the code I used to test it:

[HttpPost]
public async Task<IActionResult> TstEmbed()
{
WordDocument doc = new WordDocument();

WParagraphStyle style = doc.AddParagraphStyle("Tradition") as WParagraphStyle;
style.CharacterFormat.FontName = "TraditionSansXLight";
style.CharacterFormat.FontSize = 11f;

WParagraphStyle styleBalt = doc.AddParagraphStyle("Balthazar") as WParagraphStyle;
styleBalt.CharacterFormat.FontName = "Balthazar";
styleBalt.CharacterFormat.FontSize = 11f;

WParagraphStyle styleArial = doc.AddParagraphStyle("Arial") as WParagraphStyle;
styleArial.CharacterFormat.FontName = "Arial";
styleArial.CharacterFormat.FontSize = 11f;

IWSection section = doc.AddSection();

IWParagraph par = section.AddParagraph();
par.ApplyStyle("Tradition");
par.AppendText("This is written in Tradition Sans XLight");

IWParagraph parAr = section.AddParagraph();
parAr.ApplyStyle("Arial");
parAr.AppendText("This is written in Arial");

IWParagraph parBal = section.AddParagraph();
parBal.ApplyStyle("Balthazar");
parBal.AppendText("This is written in Balthazar");

DocIORenderer render = new DocIORenderer();
render.Settings.EmbedFonts = true;
render.Settings.EmbedCompleteFonts = true;

PdfDocument pdf = render.ConvertToPDF(doc);

render.Dispose();

MemoryStream ms = new MemoryStream();

pdf.Save(ms);
ms.Position = 0;

pdf.Close();

string contentType = "application/pdf";

return File(ms, contentType, "123.pdf");
}

If you run this, you will notice the font "TraditionSansXLight" doesn't gets embedded. It just renders the text in Arial....

Any idea?

Attachment: TraditionSansXLight_90f5fd51.rar


Edit: I just tried to convert the same PDF using the DocToPDFConverter in a MVC 5 project. This correctly embeds the font.

What I also noticed in the Core version is that the numbering of NumberedList is wrong. Sometimes shows (1) (1) (1) where the MVC 5 version does everything correctly.

I would prefer not using an extra service though but at current state the DocToPDF conversion on .NET Core isn't usable

Mohanaselvam  Jothi [Syncfusion]
Replied On May 10, 2019 08:55 AM UTC

Hi Paul,

Thank you for contacting Syncfusion support.

Regarding fonts not embedded in the generated PDF:
We can reproduce the mentioned font not embedded in the generated PDF in ASP.NET Core. Currently we are analyzing on this problem and will share you more details on 14th May, 2019.

Regarding NumberedList is wrong:
We suspect that issue might be due to code snippet and the input Word document used at your end. Could you please share us more details about this issue along with the complete code snippet and input Word document. Thereby, we will check on the reported problem and will provide you the solution at the earliest.

Please let us know if you have any other questions.

Regards,
Mohanaselvam J
 


Vijayasurya Anandhan [Syncfusion]
Replied On May 14, 2019 05:56 AM UTC

Hi Paul,

Thank you for your patience.

Please find the detail for your queries below as follows:

Regarding fonts not embedded in the generated PDF:
We confirmed that the issue with “Font not embedded in generated PDF” is a defect and we have logged a defect report. The fix for this issue is estimated to be available on 28th May 2019.

Regarding NumberedList is wrong:
As mentioned earlier, we suspect that issue might be due to code snippet and the input Word document used at your end. Could you please share us more details about this issue along with the complete code snippet and input Word document. Thereby, we will check on the reported problem and will provide you the solution at the earliest.

Please let us know if you have any other questions.


Regards,
Vijayasurya A 


Vijayasurya Anandhan [Syncfusion]
Replied On May 28, 2019 02:59 PM UTC

Hi Paul,

Thank you for your patience.

The issue with "Font not embedded in generated PDF" has been fixed and the patch for this fix can be downloaded from the following location.


Recommended approach - exe will perform automatic configuration
Please find the patch setup from below location:

http://syncfusion.com/Installs/support/patch/17.1.0.38/944040/F144521/SyncfusionPatch_17.1.0.38_944040_5282019091927081_F144521.exe

Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
Please find the patch assemblies alone from below location:

http://syncfusion.com/Installs/support/patch/17.1.0.38/944040/F144521/SyncfusionPatch_17.1.0.38_944040_5282019091927081_F144521.zip

Please find the patch NuGet alone from below location:
http://syncfusion.com/Installs/support/patch/17.1.0.38/944040/F144521/SyncfusionNuget_17.1.0.38_944040_5282019091927081_F144521.zip


Assembly Version: 17.1.0.38
Installation Directions:
This patch should replace the files
“Syncfusion.DocIORenderer.Portable.dll” under the following folder.
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.6
 
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\ 17.1.0.38\precompiledassemblies\ 17.1.0.38\4.6


Note:
To change how you receive bug fixes, ask your license management portal admin to change your project’s patch delivery mode.

https://www.syncfusion.com/account/license

Disclaimer:
Please note that we have created this patch for version 17.1.0.38 specifically to resolve the following issue reported in this forum. 144521

If you have received other patches for the same version for other products, please apply all patches in the order received.

This fix will be included in our upcoming 2019 Volume 2 release which is estimated to be available at the end of June 2019.

Regarding numbered list is wrong:
As mentioned earlier, we suspect that issue might be due to code snippet and the input Word document used at your end. Could you please share us more details about this issue along with the complete code snippet and input Word document. Thereby, we will check on the reported problem and will provide you the solution at the earliest.

Regards,
Vijayasurya A


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon