Page 1 of 1
Print Preview VS Export to PDF/docx
Posted: Mon Apr 03, 2023 2:16 pm
by csrt
Hello. I am using latest Stimulsoft JS 2023.2.1 version, and face the following issue:
Suppose we have a blank report with a text element in it, filled with text, copied from a docx file.
If we print it - it appears just as in the designer. But if we try to export it to docx or PDF - it loses the format, loses the fonts and sizes.
For example a part might be exported with the correct font Times New Roman, but another part might be exported with times_new_roman, so there is no such a font, and the appearance changes.
I've used the Demo project from the library.
Report + exported files are attached.
Re: Print Preview VS Export to PDF/docx
Posted: Tue Apr 04, 2023 1:29 pm
by Lech Kulikowski
Hello,
Please add used fonts before rendering:
Stimulsoft.Base.StiFontCollection.addOpentypeFontFile("font.ttf");
Thank you.
Re: Print Preview VS Export to PDF/docx
Posted: Tue Apr 04, 2023 2:29 pm
by csrt
Hello, thank you for your response.
I'm afraid the solution proposed is not viable, since it implies that I know what font will be used, which I obviously don't.
Besides, if there are used 2 3 10 fonts? To import them all manually?
Just to be clear - we are not talking about some custom fonts. These are regular fonts, like Times New Roman, available in Stimulsoft Designer. So I assume that the fonts are available already, since they can be used in designer. In one of the exported docx files I saw the next behavior: first page had the available font "Times New Roman", and the next ones had the font "times_new_roman" - it looks like an export bug. Can you please check this aspect as well? The exported document is attached.
As well, can you please tell me if there will be a more automatic solution for this problem in next patches, that will account for used fonts and export to files properly?
Re: Print Preview VS Export to PDF/docx
Posted: Wed Apr 05, 2023 7:15 pm
by Lech Kulikowski
Hello,
1. You text component with a large height placed directly on the page. Please place it on the databand for correct splitting on pages.
2. In your text is used the following string:
<span style="font-family: "Times New Roman";">denumit
we do not support such a combination:
https://www.stimulsoft.com/en/documenta ... nt_tag.htm
that is the issue with exporting.
Thank you.
Re: Print Preview VS Export to PDF/docx
Posted: Thu Apr 06, 2023 8:34 am
by csrt
Hello, thank you for your answer - we will try to be more careful next time.
By the way, is there a correct way to import some pre-formatted text from an outside .docx document into the designer, so that there are no issues with fonts and format?
Re: Print Preview VS Export to PDF/docx
Posted: Fri Apr 07, 2023 8:06 am
by Lech Kulikowski
Hello,
Unfortunately, we do not have any special options, or methods to import formatted text.
Thank you.