Page 1 of 1

Rendering to Word (.Doc)

Posted: Thu Dec 15, 2022 10:16 am
by Réda
Hello,

I am using the text editor QuillJs to design some part of my report. The result is saved in database. Here is an example of the produced HTML :

Code: Select all

<div><span style="font-size: 18px; font-family: Calibri;">Hello world </span></div><div><span style="font-size: 18px; font-family: Calibri;">this is my text</span></div>
The issue this time is that when I open the created .doc file in MS Word, the text size is not rendered as expected. For an 18px font-size, the text is rendered as 13.5 in Word.
I did several tests with different font-style and font-size, but the result is still the same.

Code: Select all

<div><span style="font-family: Impact; font-size: 36px;">Hello world </span></div><div><span style="font-family: Impact; font-size: 36px;">this is my text</span></div>
For a 36px font-size, it is rendered as 27 in Word.

Attached you will find two of my generated examples .doc reports.

So my question is, does Stimulsoft expects a specific format when it comes to HTML tags ? According to your documentation it should be working. Am I missing something ?

EDIT: Based on your documentation, I assumed Stimulsoft works with HTML 4 tags and it gave me an idea so I tried something : I removed the pixels (px) from the inline-style in my database field

Code: Select all

<div><span style="font-family: Impact; font-size: 36">Hello world </span></div><div><span style="font-family: Impact; font-size: 36">this is my text</span></div>
The new report is attached : 12_15_2022 10 42 02 AM.doc
I have no idea why, but the report is correctly rendered in Word now... Any hint please ?

Re: Rendering to Word (.Doc)

Posted: Thu Dec 15, 2022 3:13 pm
by Lech Kulikowski
Hello,

We need some additional time to investigate the issue, we will let you know about the result.

Thank you.
#9513

Re: Rendering to Word (.Doc)

Posted: Fri Jan 06, 2023 12:16 pm
by Réda
Hello,

Any news about my issue please ?

On the other hand, I found another issue.. For this produced HTML :

Code: Select all

<div><span style="font-size: 10; font-family: Calibri;">Hello</span></div><div><span style="font-size: 10; font-family: Calibri;">world</span></div>
There is an unexpected new line/line-break between my first line "Hello" and second line "world" inside the generated Word file.

Attached are both the original generated Word file (from my HTML code right above) and the expected Word file (that I created myself)

Re: Rendering to Word (.Doc)

Posted: Fri Jan 06, 2023 1:42 pm
by Lech Kulikowski
Hello,

We work hard on this problem and do our best to do it as fast as possible. We will let you know when the solution is available.

Thank you.

Re: Rendering to Word (.Doc)

Posted: Tue Apr 25, 2023 7:49 am
by Réda
Hello,

It has been quite a while now. Any updates regarding my issue ?

Re: Rendering to Word (.Doc)

Posted: Wed Apr 26, 2023 6:15 am
by Lech Kulikowski
Hello,
The issue this time is that when I open the created .doc file in MS Word, the text size is not rendered as expected.
For an 18px font-size, the text is rendered as 13.5 in Word.
So my question is, does Stimulsoft expects a specific format when it comes to HTML tags ?
According to your documentation it should be working. Am I missing something ?
Points are traditionally used in print media (anything that is to be printed on paper, etc.).
In most applications that create documents for printing, the font size is specified in points. In Microsoft Word/Excel/PowerPoint, the font size is set to points, as in our product.

Different units of measurement may be used in html-writing.
The most commonly used units are pixels. These units are 1px = 0.75pt. Therefore the size in pixels is 25% less than the size in points.

Our documentation on html tags explicitly states:
"The size attribute defines the size of the text in the font element in points."
If the unit of measure is not explicitly specified, we assume that it is points, If it's not explicitly specified, we think it's points, if it's a different unit, we convert it to points.
so 18px equals 18 * 0.75 = 13.5pt
On the other hand, I found another issue.. For this produced HTML : ....
There is an unexpected new line/line-break between my first line "Hello"
and second line "world" inside the generated Word file.

Attached are both the original generated Word file (from my HTML code right above)
and the expected Word file (that I created myself)
We have analyzed your doc-files. Wwe do not see any "an unexpected new line/line-break between lines".

What difference do we see:
Our product exports to MS-Word in Table-mode. In this mode all objects of a report are converted to the single table.
Only in table-mode you can place numerous text boxes on a page in any order, while maintaining their relative position and size.

It is possible to output the text in a break in the table. The string-commands "rtfparagraph" can be written in the Tag field:
https://www.stimulsoft.com/documentatio ... _modes.htm

Thank you.