Page Setup Headers and Footer don't show in pdf

General TRichView support forum. Please post your questions here
Post Reply
Posts: 175
Joined: Thu Sep 15, 2005 1:41 am
Location: California

Page Setup Headers and Footer don't show in pdf

Post by jimmaguire » Fri Nov 10, 2017 1:36 am

Hi Sergey,

Just upgraded to 17.0.2 and was excited about the Headers/Footers features. This will be extremely useful to my users.

I created a simple file (TestFooter.rvf) using ActionTest.exe and clicked File/Page setup to add a header and footer, they show in Print Preview, look great but then opened it in RVLLPDFLibDemo.exe, saved to pdf, and no footer or header? How can I use the Page Setup Footer in LLPDFLib?

Looking at your Assorted\Printing\Headers demo, and see that its much more complete and allows separate rvf's to be used as headers and footer, very powerful and useful.

What would really be helpful is if Assorted\Printing\Headers would be integrated with the RVLLPDFLibDemo to produce a pdf that has the headers/footers. Can you do that or at least send some sample code to point the way to do it?
I tried adding a rve.Save to it and opened it in LLPDFlib, but no headers

Thanks as always!
(1.01 KiB) Downloaded 41 times
(11.7 KiB) Downloaded 39 times

Sergey Tkachenko
Site Admin
Posts: 13833
Joined: Sat Aug 27, 2005 10:28 am

Re: Page Setup Headers and Footer don't show in pdf

Post by Sergey Tkachenko » Fri Nov 10, 2017 9:30 am


The ActionTest demo does not add headers and footers to documents. The actions can draw a text string as a header/footer, but they do not save it in documents.

The real headers/footers must be separate documents assigned as header/footers using SetHeader/SetFooter method.
Yes, the demo in Assorted\Printing\Headers\ do it, and ActionTest demos do not.


1) Create a program like Assorted\Printing\Headers

2) Store text strings used to draw headers by actions. They are in RVAControlPanel.Header and Footer properties. You can store they in RIchViewEdit.DocProperties (sting list that can be saved and loaded in RVF) or DocObjects (collections of objects, published properties of objects can be stored in RVF). Encode properties to save in rvActionSave.OnSaving, decode them in rvActionOpen.OnOpenFile.
In the PDF generation demo, you need to assign RVPrint.OnPagePrepaint = rvActionPrint.PagePrepaint.
Unfortunately, TrvCustomPrintAction.PagePrepaint is protected, not public, so you need to modify RichViewActions.pas to make it public. I'll make it public in the next update.

3) Use ScaleRichView. It allows editing all headers and footers in a single component, TSRichViewEdit.

Post Reply