in reply to PDF Page numbers

There is no standard way to add page numbers or other header or footer data to PDF documents. This is because PDF is just a printing format; it has no knowledge of the graphical layout rules of the program that produced it.

So the best way is probably to use prText() at an (x,y) location of your choosing and keep it consistent throughout your document. If your document opens like book or magazine, then positions of the page numbers should be set spearately for the left and right facing pages, e.g., lower left corner for left ages and lower right corner for right pages.

-Mark

Replies are listed 'Best First'.
Re^2: PDF Page numbers
by artist (Parson) on Mar 14, 2005 at 21:53 UTC
    Thanks Mark, I am trying to put it together. I like to paginate every page of Infile. The following code gives some type of problem. I have 9 pages in the infile, and it gives page numbers to 5 pages only and erase original data after page 1.

    use PDF::Reuse; use strict; my $infile = 'in.pdf'; my $outfile = 'out.pdf'; prFile($outfile); my $count; my $page = 1; prFont('Courier-Bold'); # Sets font prFontSize(20); # And font size while(1){ $count = prDoc({ file => $infile, first => $page, last => $page , # page => $page }); last if $count == 0; prText(250,50, "Page:$page"); prPage(); $page += 1; } prEnd();

    Appreciate some help
    Thanks