I would like to ask if there are any correct way to set the correct fonts to the content of exported/converted PDF file from Document Editor component?
My initial Document's font is set to Impact (in Document Editor component) to its whole content and then when I call the backend service which converts the content of SFDT file to PDF file using the following sample code is not working:
DocIORenderer renderer = new DocIORenderer();
renderer.Settings.PdfConformanceLevel = PdfConformanceLevel.Pdf_A1B;
renderer.Settings.EmbedFonts = true;
renderer.Settings.EmbedCompleteFonts = true;
PdfDocument pdfDocument = renderer.ConvertToPDF(document);
Even though, I have set the DocIORenderer's settings of EmbedFonts and EmbedCompleteFonts to true, it is no help at all and the final converted PDF file ends up having a title in Times New Roman and the rest in Arial fonts.
I have also attached the sample screenshots and the list of fonts which I have installed in my Docker container running in Linux.
We suspect that the reported problems might be due to the contents of the input Word document used at your end. We need to investigate the contents of your input Word document to reproduce the exact problem at our end. So, could you please provide us the input Word document that was used at your end? Thereby, we will analyze further and provide you the appropriate solution at the earliest.
Hello Kavitha M,
I have attached a sample SFDT file which is stored in our DB and on user request opened in DocumentEditor, then sent to ASP.NET Core backend service to be converted to PDF file.
By the way, we are using:
Ignacy, We tried to reproduce the reported issue by converting the Word document (that is converted from the SFDT) to PDF in a Linux Docker container on our end. But it works properly on our end. We have attached the sample that we used to try to reproduce the issue.
Note: Please find the input document "sample.docx" and output PDF "WordToPDF_SyncfusionDocker.pdf" generated in our end
We suspect that the issue is due to the docker commands that you used in your docker file. We have attached the sample, which contains the docker file. Please compare your docker commands with our docker commands and try to resolve the issue.
Please refer the below UG documentation to know about installing necessary fonts in Linux containers
Please see the UG documentation below to learn more about Word to PDF conversion in Linux.
You can also use the SubstituteFont event. You can identify the missing font during Word to PDF conversion. Please refer here for more information about this.
If you have a list of fonts in some folder and are having trouble installing the font in Docker, we recommend using the font substitution event to set the fonts that are missing in our system.
To learn more about font substitution, please refer to our documentation at the below link.
Thank you very much for a quick response. I will check them and will let you know if the problem has been resolved.
You are welcome, Ignacy
Even though, our project's Dockerfile looks identical to Dockerfile which you have sent me earlier, it is still no use.
I am sending a SampleController.txt and the JSON.txt which is received by the DownloadSfdtAsPdf endpoint as attachment.
Ignacy, Currently, we are checking the reported issue and will update details by January 31, 2023.
Apologies for the delay.
we can reproduce the reported case. Currently, we are validating and will update you the details by February 7,2023.
Ignacy, we have confirmed the reported issue as a defect and logged a defect report. We will fix this issue in our upcoming EJ2 patch release which is scheduled on end of February.
You can track the status of the bug through the below feedback link:
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Ignacy, We are glad to announce that our patch release (v20.4.52) has been rolled out successfully. In this release, we have added the fix for the reported issue in "Set correct fonts to converted PDF files".
Please upgrade to the latest version packages to resolve this issue:
Please let us know if you need any further assistance.
Thank you very much for the update. I will let you know if everything is all right.
Thanks for your update