Page 1 of 1

auto page numbers in body of text

Posted: 2016-10-18 23:56:36
by ngazidja
Yes: is it possible to have auto page numbers in the body of a text or just in the headers/footers? Inserting a page number only inserts to the current page and I want a page number on every page (without having to manually insert into every page).

(Background: I'm clunkily trying to print out 200 copies of a one page form, each of which has a unique serial number. I designed the form in NWP and then realised that rather than printing out 200 copies and hand-numbering them, I could auto this... perhaps? Maybe if the whole document was just one big header? Is that scary or what?)

(Nope, can't make the header cover the whole page - only to 159 mm. Maybe we could fix this? :) )

Re: auto page numbers in body of text

Posted: 2016-10-19 00:21:50
by ngazidja
Ok, I've sort of answered my own question: yes and no (if anyone's interested). Since my form was a table, and perfectly sized for the page, I inserted an auto page no. in the appropriate place, copied the whole table and pasted 200 copies. So the page number has to be manually inserted, but holding down cmd-v for 30 seconds is pretty close to auto-inserting on 200 pages.

Re: auto page numbers in body of text

Posted: 2016-10-19 01:54:19
by phspaelti
I'm glad to hear that you got this to work, but usually a more appropriate way to do this would be via macro which can quickly insert number as "stamps" in any sequence and without regard to the page number. Such a macro can also be tailored to insert the number in whatever place you desire.
Below is the code that would replace place holders of the shape "###" with running numbers from 1 to however many.

Code: Select all

$doc =

$nums = $doc.text.findAll “###”

$counter = $nums.count
foreach $num in reversed $nums
	$num.text.replaceInRange $num.range, $counter
	$counter -= 1

Re: auto page numbers in body of text

Posted: 2016-10-19 02:00:00
by ngazidja
Thanks for that. It certainly sounds like a more professional way of doing it (although for me, way slower. :) )