DocX load field gets wrong Font/Style

General TRichView support forum. Please post your questions here
Post Reply
a.weber
Posts: 63
Joined: Wed Mar 02, 2022 7:02 am

DocX load field gets wrong Font/Style

Post by a.weber »

Hello,
some of our documents with fields gets a wrong font and style after substition. I found that these fields have repeated format commands inside the docx XML - Word seems to ignore them and use only the first? I have modifed RV docx reader the same way - it seems to work - can you check this please?

The expression VERT_ORT is formated as "Arial 10"
field_original.png
field_original.png (49.84 KiB) Viewed 59635 times


After a load / save with RichView its a "Times New Roman" 12
field_replaced.png
field_replaced.png (47.92 KiB) Viewed 59635 times
if I investigate the docx XML I can see that there are some style informations with Times New Roman assigned to this field - but in Word I never see this formating - also if I have select the whole text of this document and assign a new font - the result stays the same this single entry "vert_ort" turns into
"Times New Roman".

(As private message I sent you my modified RVDocXReader.pas - with my WorkAround to read only the first CharProps entry.)

With best regards
André
Attachments
field_replaced.docx
(3.44 KiB) Downloaded 2301 times
field_original.docx
(21.02 KiB) Downloaded 2329 times
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: DocX load field gets wrong Font/Style

Post by Sergey Tkachenko »

Thank you!
I accepted your code modification.
It will be included in the next update.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: DocX load field gets wrong Font/Style

Post by Sergey Tkachenko »

Foxed in TRichView 22.2
a.weber
Posts: 63
Joined: Wed Mar 02, 2022 7:02 am

Re: DocX load field gets wrong Font/Style

Post by a.weber »

Ok - tested - works - one point less on the list.
Post Reply