Headers and footers in PDF output

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Ajm
Posts: 19
Joined: Tue Mar 04, 2014 7:21 pm

Headers and footers in PDF output

Post by Ajm » Thu Feb 18, 2021 4:08 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9751
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Headers and footers in PDF output

Post by dunbarx » Thu Feb 18, 2021 4:31 pm

Hi.

I have used the "open printing to PDF" directly, but never played with the options. Check out the entry in the dictionary.

Craig

Klaus
Posts: 13865
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Headers and footers in PDF output

Post by Klaus » Thu Feb 18, 2021 4:37 pm

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

Ajm
Posts: 19
Joined: Tue Mar 04, 2014 7:21 pm

Re: Headers and footers in PDF output

Post by Ajm » Thu Feb 18, 2021 5:55 pm

@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

Klaus
Posts: 13865
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Headers and footers in PDF output

Post by Klaus » Thu Feb 18, 2021 5:58 pm

Hi Andy,

aha, take a look at -> revPrintText
That command supports header and footer!


Best

Klaus

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9855
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Headers and footers in PDF output

Post by FourthWorld » Thu Feb 18, 2021 6:15 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Ajm
Posts: 19
Joined: Tue Mar 04, 2014 7:21 pm

Re: Headers and footers in PDF output

Post by Ajm » Thu Feb 18, 2021 6:29 pm

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
Regards

Andy
DB Integration Limited

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9855
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Headers and footers in PDF output

Post by FourthWorld » Thu Feb 18, 2021 6:43 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Ajm
Posts: 19
Joined: Tue Mar 04, 2014 7:21 pm

Re: Headers and footers in PDF output

Post by Ajm » Thu Feb 18, 2021 9:04 pm

Thanks for everyone's help.

I've switched to using revprinttext and it works great.

Regards
Andy
Regards

Andy
DB Integration Limited

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”