Page 1 of 1
Headers and footers in PDF output
Posted: Thu Feb 18, 2021 4:08 pm
by Ajm
Hi,
Having looked through the pdf lessons and examples and the dictionary I can't find any information on creating headers and footers when printing to pdf.
I've worked out that you can format a field with tables and output the field but I would like to just have a header and footer set up that gets output on every page.
Does anyone know if this is possible?
Regards
Andy
Re: Headers and footers in PDF output
Posted: Thu Feb 18, 2021 4:31 pm
by dunbarx
Hi.
I have used the "open printing to PDF" directly, but never played with the options. Check out the entry in the dictionary.
Craig
Re: Headers and footers in PDF output
Posted: Thu Feb 18, 2021 4:37 pm
by Klaus
Hi Craig,
dunbarx wrote: ↑Thu Feb 18, 2021 4:31 pm
I have used the "open printing to PDF" directly, but never played with the options. Check out the entry in the dictionary.
do you mean the parameter used in "... with options..."?
That will only add some
metadata to the resulting PDF for:
Title, Author, Subject, Keywords, Creator, Producer.
@Andy
You need to create this by yourself!
How are you currently printing your stuff?
The trick is to print a card with some selfmade header/footer in a loop and
change the info in your header/footer in every loop like pagenumber or whatever.
Best
Klaus
Re: Headers and footers in PDF output
Posted: Thu Feb 18, 2021 5:55 pm
by Ajm
@Craig, I did look at the options and could only see the meta data settings.
@Klaus, I'm currently just populating a field with the information I need, running it through some formatting to add tables to the data. Then printing the field using revprintfield. This way I get the formatting I want and the data breaks across pages automatically.
I was hoping there was an option to have a header and footer handler or something similar.
Regards
Andy
Re: Headers and footers in PDF output
Posted: Thu Feb 18, 2021 5:58 pm
by Klaus
Hi Andy,
aha, take a look at -> revPrintText
That command supports header and footer!
Best
Klaus
Re: Headers and footers in PDF output
Posted: Thu Feb 18, 2021 6:15 pm
by FourthWorld
Klaus wrote: ↑Thu Feb 18, 2021 5:58 pm
aha, take a look at -> revPrintText
That command supports header and footer
Also useful: read the code for revPrintText, and see how it uses "print into <rect>" to create its header and footer.
Re: Headers and footers in PDF output
Posted: Thu Feb 18, 2021 6:29 pm
by Ajm
Thank you Klaus and Richard. That looks more like what I need. Once I saw the revprintfield command I didn't bother to look at revprinttext.
Regards
Andy
Re: Headers and footers in PDF output
Posted: Thu Feb 18, 2021 6:43 pm
by FourthWorld
Ajm wrote: ↑Thu Feb 18, 2021 6:29 pm
Once I saw the revprintfield command I didn't bother to look at revprinttext.
That's a good choice. RevPrintField is a wrapper for revPrintText that provides a few convenient extras for when the data to be printed is already in a field.
Re: Headers and footers in PDF output
Posted: Thu Feb 18, 2021 9:04 pm
by Ajm
Thanks for everyone's help.
I've switched to using revprinttext and it works great.
Regards
Andy