Empty Header and Footer problem

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

Empty Header and Footer problem

Post by a.weber »

Hello Sergey,
saveing a DocX / RTF with ScaleRichView generates a header and footer, also if there is none, with an empty paragraph which uses the document "default?" first style?
In some of my cases the height of header and footer is set to zero or even a very small value and the pages borders too.
But if I open the new saved files with MS Word - the header/footer height is increased according to the empty paragraph's font height.
Which moves the whole layout verticaly.

Original DOCX in Word @100%
DocumentWithoutHeaderAndFooters_MSWord.png
DocumentWithoutHeaderAndFooters_MSWord.png (5.97 KiB) Viewed 35018 times
After save with ScaleRichView
DocumentWithoutHeaderAndFooters_ScaleRichView.png
DocumentWithoutHeaderAndFooters_ScaleRichView.png (7.33 KiB) Viewed 35018 times
you can see the newly generated paragraph - this changes the print result and PDF export of MS Word to move the whole layout.
(If I deleted the empty paragraph all is fine again)

Is there a way in ScaleRichView to suppress the storage of empty headers and footers?

Useing plain TRichView I can do something like this before saveing:
if rvHeader_Normal.RVData.IsEmpty then
rvBody.SetHeader(nil, TRVHFType.rvhftNormal);
- but I think this should happen inside the default save logic?

With best regards

André
Attachments
DocumentWithoutHeaderAndFooters_MSWord.docx
Just for info the Original DOCX
(14.32 KiB) Downloaded 1883 times
DocumentWithoutHeaderAndFooters_ScaleRichView.docx
The ScaleRichView generated DOCX
(5.87 KiB) Downloaded 1838 times
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Empty Header and Footer problem

Post by Sergey Tkachenko »

I'll check this problem at the beginning of the next week.
I this week I need to complete Delphi 12-compatible update.
a.weber
Posts: 63
Joined: Wed Mar 02, 2022 7:02 am

Re: Empty Header and Footer problem

Post by a.weber »

Ok - tested - works - one point less on the list.
With Version 22.2 at least. Thank You
Post Reply