- Home
- Forum
- ASP.NET Core - EJ 2
- Converting docx to Pdf in a docker container
Converting docx to Pdf in a docker container
Hi guys,



Attachment: DockerDocumentGeneration_7081f09f.zip
I am trying to convert a docx file to pdf in a docker container. The font height is messed up in the generated pdf.
Below is the original docx file
Once generated via docker container, the pdf font height spacing is incorrect
I have attached a sample solution to demonstrate the issue. once you have downloaded the zip folder, execute the build.cmd to publish the console app and then execute the run.cmd to run the app. you will get the generated pdf in the publishOutput folder
Please treat this as urgent. Waiting for your reply.
Thanks
Thanks
Ootam
Attachment: DockerDocumentGeneration_7081f09f.zip
SIGN IN To post a reply.
3 Replies
KC
Karthikeyan Chandrasekar
Syncfusion Team
January 9, 2019 12:25 PM UTC
Hi Ootam,
From the given details and the code snippet, we have found that you used SubstituteFontEventHandler to set alternate font if the font not installed in the environment.
We suggest you to use the below modified code snippet in your application to set alternate font when a specified font is not installed in the production environment.
We suggest you to use the below modified code snippet in your application to set alternate font when a specified font is not installed in the production environment.
|
wordDocument.FontSettings.SubstituteFont += (sender, eventArgs) =>
{
// Sets the alternate font when a specified font is not installed in the production environment.
if (eventArgs.OriginalFontName == "Arial")
{
FileStream template = new FileStream(@"Arial.ttf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
eventArgs.AlternateFontStream = template;
}
else if (eventArgs.OriginalFontName == "Calibri")
{
FileStream template = new FileStream(@"Calibri.ttf", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
eventArgs.AlternateFontStream = template;
}
else if(eventArgs.OriginalFontName == "Arial Unicode MS")
{
FileStream template = new FileStream(@"ARIALUNI.TTF", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
eventArgs.AlternateFontStream = template;
}
}; |
If you are still facing the preservation problem, could you please provide us the generated PDF document and the fonts (font files *.ttf) used at your end. This will be more be more helpful to analyze on the reported problem and will provide you the solution at the earliest.
Regards,
Karthikeyan
OS
Ootam Seewoogoolam
January 9, 2019 02:46 PM UTC
Hi Karthikeyan,
Attachment: PublishOutput_f937e896.rar
In my previous post, I have attached the full test solution which you can run on your side and get the output i have attached 'PublishOutput_f937e896.rar'
I have tested the proposed solution and does not resolve the issue. Please try running the solution in linux docker.
Thanks again
Ootam
Attachment: PublishOutput_f937e896.rar
KC
Karthikeyan Chandrasekar
Syncfusion Team
January 10, 2019 05:00 PM UTC
Hi Ootam,
With this details we can reproduce the reported preservation problem and it will be fixed in our 2018 Volume 4 SP1 release which is expected to be available on February, 2019
Regards,
Karthikeyan
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
OS Ootam Seewoogoolam
- Jan 8, 2019 11:08 AM UTC
- Jan 10, 2019 05:00 PM UTC