Page 1 of 1

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

Posted: Tue Dec 08, 2015 8:51 am
by Monox18
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.

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

Posted: Tue Dec 29, 2015 4:58 pm
by MaxV
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