X-Git-Url: https://vcs.fsf.org/?p=exim.git;a=blobdiff_plain;f=doc%2Fdoc-docbook%2FPageLabelPDF;h=454d0ec4a8006d53ec748c610b0c11b9963ad318;hp=aa144e208a04ac64be3e3b2bd4845c3d20ac38cc;hb=d1f9fb42472323edb17c3ee3cbbfce3557083ceb;hpb=9b3719888275859f10e5a8c6e87a92899abc0d95 diff --git a/doc/doc-docbook/PageLabelPDF b/doc/doc-docbook/PageLabelPDF index aa144e208..454d0ec4a 100755 --- a/doc/doc-docbook/PageLabelPDF +++ b/doc/doc-docbook/PageLabelPDF @@ -1,20 +1,19 @@ #! /usr/bin/perl -w -# $Cambridge: exim/doc/doc-docbook/PageLabelPDF,v 1.1 2006/02/01 11:01:01 ph10 Exp $ - # Program to add page label information to the PDF output file. I have not # found a way of automatically discovering the number of frontmatter pages -# in the document. It is therefore screwed in as 12 in the next statement. +# in the document. It is therefore taken as an argument to be inserted into the +# next statement. $add = "/PageLabels << /Nums [ 0 << /S /r >>\n" . - " 12 << /S /D >>\n" . + " $ARGV[0] << /S /D >>\n" . " ]\n" . " >>\n"; $extra = length $add; $before = 0; -while (<>) +while () { print; $before += length($_); @@ -23,13 +22,13 @@ while (<>) print $add; -while (<>) +while () { print; last if $_ =~ /^xref$/; } -while (<>) +while () { if (/^(\d{10}) (.*)/) { @@ -40,7 +39,7 @@ while (<>) elsif (/^startxref/) { print; - $_ = <>; + $_ = ; if (/^(\d+)/) { print $1 + $extra, "\n";