How to get the header/footer in a .rtf file?

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
Monox18
Posts: 118
Joined: Tue Nov 25, 2014 9:48 pm

How to get the header/footer in a .rtf file?

Post by Monox18 » Tue Dec 08, 2015 8:51 am

Hello,

I've been saving a .doc template as a .rtf, then I open it in LC and paste it in a field by setting its RTFText property. Then I use both Text and HTMLText to modify the text, parse, replace, put format, etc. Finally, I print the results as a PDF by using revPrintField. It works well so far. I'm doing very basic editing and formatting. However, the header/footer and double column is not properly displayed in the field. Any ideas how can I extract the header, body and footer, work with them and properly print them as a PDF? Thanks!


Monox.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: How to get the header/footer in a .rtf file?

Post by MaxV » Tue Dec 29, 2015 4:58 pm

I would use revPrinText this way:

########CODE#######
put the text of field "myLongText" into textToPrint
put "Left Header" & TAB & "Cetral Title" & TAB & "Right header" into MyHeaders
put "Left Footer" & TAB & "Central Footer" & TAB & "<%pageNumber%> / <%numPages%>" into myFooters
revPrintText TextToPrint,MyHeaders,MyFooters
#####END OF CODE#####

And your text may be formatted as you like and livecode automatically split and create the pages.

This is a result:
Image
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply