Problem with PDF export in k8s, windows 2019

Stimulsoft Reports.WEB discussion
AntonCanopy
Posts: 1
Joined: Fri Apr 17, 2020 4:26 am

Problem with PDF export in k8s, windows 2019

Post by AntonCanopy »

Hello, please help us to solve the following issue.

For a long time we use Stimulsoft Reports.Web in docker with Windows 2016. It worked perfectly. Recently we moved to Windows Server 2019, so base image was updated to windows server core ltsc2019.

After we did this we spotted that this image has only 1 font. And in Reports Designer we saw jsut 1 font available. To solve this we copied fonts from old env to new image to C:\Windows\Fonts. This helped with designer - now we see all fonts.
Report generation also works fine. Preview report - also fine. But when we export we see strange symbols instead.

Please see attachments.


Version we use: 2019.2.3.0

Note: when we export to JPEG - all fine, Powerpoint - fine. But PDF and XPS - bad.

What could be the reason?
Attachments
Stimulsoft-2.png
Stimulsoft-2.png (7.35 KiB) Viewed 2594 times
stimulsoft-1.png
stimulsoft-1.png (11.96 KiB) Viewed 2594 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem with PDF export in k8s, windows 2019

Post by HighAley »

Hello, Alex.

We have analyzed your PDF file.
Two fonts are used there. LucidaConsole and Arial.

But instead of the Arial font, the Marlett font is embedded into the PDF file.
The glyph encodings are different in these fonts, so you don't get the necessary symbols and get squares instead.
It seems that the GDI library returns the Marlett font file instead of Arial. We don't know why.
It could be a bug of this library or something else.

We so the issue before but were not able to reproduce and solve it.

At this moment, we know that the font file should contain the TrueType Outlines.
If there are any other outlines, for instance, OpenType/PostScript, this font cannot be processed right. And you will not get the right PDF file.

Thank you.
e.andrukh
Posts: 14
Joined: Mon Feb 28, 2022 5:48 pm

Re: Problem with PDF export in k8s, windows 2019

Post by e.andrukh »

Any news about this issue?

I faced similar issue:
I use method for report generation.
StiReport.ExportDocument(StiExportFormat exportFormat, Stream stream);

And this method for web preview
StiReport.SaveDocumentJsonToString()

Exporting to PDF works correctly with WIndows Server 2016 image in k8s, but not with Windows Server 2019 image.

Windows Server 2019 has only one font.
PDF and web preview look the same, but not as desired.

So I copied all fonts and registered them.
After that web preview works correctly, but PDF looks like I didn't add any fonts.

To reproduce it try to add any Arial text in designer and export report to PDF.
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Problem with PDF export in k8s, windows 2019

Post by Lech Kulikowski »

Hello,

Please send us your PDF file for analysis.

Thank you.
e.andrukh
Posts: 14
Joined: Mon Feb 28, 2022 5:48 pm

Re: Problem with PDF export in k8s, windows 2019

Post by e.andrukh »

old-credit_note_request_20220221_1653.pdf - how it should be

new-credit_note_request_20220221_1656.pdf - generated on windows server 2019
Attachments
old-credit_note_request_20220221_1653.pdf
(91.12 KiB) Downloaded 117 times
new-credit_note_request_20220221_1656.pdf
(37.69 KiB) Downloaded 127 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem with PDF export in k8s, windows 2019

Post by HighAley »

Hello, Eugene.

We see that in new report other fonts are embedded.
Please, try to add the right fonts to StiFontCollection.

For now, different styles with the same font name could not be shown now.
But at least, the fonts should be right.

The different styles will be shown in our next build.

Thank you.
e.andrukh
Posts: 14
Joined: Mon Feb 28, 2022 5:48 pm

Re: Problem with PDF export in k8s, windows 2019

Post by e.andrukh »

We see that in new report other fonts are embedded.
Could you provide more details?
In Adobe Acrobat Reader document properties I see the same fonts for both documents.
Arial TrueType (CID), Identity-H
Arial,Bold TrueType (CID), Identity-H
Please, try to add the right fonts to StiFontCollection.
How can I know which fonts should be added?
Report templates are created by our consultants, and can contain any font (available in report designer)
For now, different styles with the same font name could not be shown now.
But at least, the fonts should be right.
Are you saying that report is generated using Arial font but with different style?
For me it looks like it's generated by default font (and only one) in Windows Server 2019 - Lucida Console.
The different styles will be shown in our next build.
Are you saying this issue will be fixed in next build?
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Problem with PDF export in k8s, windows 2019

Post by Lech Kulikowski »

Hello,

> In Adobe Acrobat Reader document properties I see the same fonts for both documents.
> Arial TrueType (CID), Identity-H
> Arial,Bold TrueType (CID), Identity-H

This is a bug in the GDI library on some systems.
The font is created correctly, the text is drawn with it correctly, the font sizes are measured correctly.
But when asked GDI for this font file, it gives a different font file. That is why we advise you to try loading fonts with StiFontCollection, this should solve the problem.

> How can I know which fonts should be added?
> Report templates are created by our consultants, and can contain any font (available in report designer)

You can do it from code, get all components of the report and check its fonts.

> Are you saying that report is generated using Arial font but with different style?
> For me it looks like it's generated by default font (and only one) in Windows Server 2019 - Lucida Console.

Your report uses Arial, Regular and Bold styles. Because of a bug, another font is exported to GDI, "Lucida Console".
But that's not what we were talking about.
At the moment, when you load fonts through StiFontCollection only one of the styles is loaded. In the next build all styles will be loaded normally.

> Are you saying this issue will be fixed in next build?

The problem with StiFontCollection will be fixed.
System problem - unfortunately, at the current moment, we have no idea how to fix it.

Thank you.
e.andrukh
Posts: 14
Joined: Mon Feb 28, 2022 5:48 pm

Re: Problem with PDF export in k8s, windows 2019

Post by e.andrukh »

Please, let me know when next build is available to try.
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Problem with PDF export in k8s, windows 2019

Post by Lech Kulikowski »

Hello,

The next release build will be available within two or three weeks.

Thank you.
Post Reply