Page numbers

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dalkin
Posts: 183
Joined: Wed Jul 04, 2007 2:32 am
Contact:

Page numbers

Post by dalkin » Thu Sep 04, 2008 10:14 am

Is there a known way of forcing page numbering when printing from a scrolling text field? Being a wordy sort of bloke, I've got about 8 pages I'd like people to print but without page numbers, it gets a bit messy. I'd do it as a pdf but I want user edits as well.
The underlying purpose of Al is to allow wealth to access skill
while removing from the skilled the ability to access wealth.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Sep 04, 2008 12:32 pm

Use the 'revPrintText' command: it allows you to pass header and footer text which can include special expressions - from the documentation:
You can also use the special values <%pageNumber%> and <%numPages%> in the textToPrint, headerText, or footerText. These expressions are replaced with the current page number or total number of pages respectively.
So basically you'd have something like:

Code: Select all

on mouseUp
  put the htmlText of field "Scrolling Field" into tBodyHtmlText
  put "Page: <%pageNumber%> of <%numPages%>" into tFooterText
  revPrintText tBodyHtmlText, empty, tFooterText
end mouseUp
Hope this helped,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

dalkin
Posts: 183
Joined: Wed Jul 04, 2007 2:32 am
Contact:

Post by dalkin » Thu Sep 04, 2008 10:40 pm

Cheers for that, Jan. The kids can make their own damn breakfast this morning - I'm going to try it now!
The underlying purpose of Al is to allow wealth to access skill
while removing from the skilled the ability to access wealth.

Post Reply