hankivy / text2pdf2

An enhanced version of text2pdf, as in the PDF::API2 perl module at https://cpan.org
GNU General Public License v3.0
0 stars 0 forks source link

No support for pagelabel, page number, methods #6

Open hankivy opened 5 years ago

hankivy commented 5 years ago

The following pagelabel method is not supported. (See PDF::API2 in CPAN.)

$pdf->pageLabel($index, $options)

The documentation for pagelabel in PDF::API2 follows:

$pdf->pageLabel($index, $options) Sets page label options.

Supported Options:

-style
    Roman, roman, decimal, Alpha or alpha.
-start
    Restart numbering at given number.
-prefix
    Text prefix for numbering.

Examples:

Start with Roman Numerals

$pdf->pageLabel(0, {-style => 'roman' });

Switch to Arabic

$pdf->pageLabel(4, {-style => 'decimal'});

Numbering for Appendix A

$pdf->pageLabel(32, {-start => 1, -prefix => 'A-'});

Numbering for Appendix B

$pdf->pageLabel( 36, {-start => 1, -prefix => 'B-'});

Numbering for the Index

$pdf->pageLabel(40, {-style => 'Roman', -start => 1, -prefix => 'Index ' });

{Owner: I have not seen documentation and/or examples of page numbering/labeling in action. Full examples should show control of the location of the page label in a header, footer, on the left, on the right, and possibly alternating left/right. And control of font, size, etc.}

{Owner: I am open to a proof of concept example of some code that builds a PDF file with fixed text, without reading a text file, that demonstrates control of location, font, and size. The proof of concept code could be written and tested without doing a design, or test text file or error checking, or checkpointing with the owner until the proof of concept program is ready to review for completeness.}

Support could be added with a single line of text to start/change page numbering as the PDF file is built.

  1. Design - Offer changes to documentation to show your design for the commands in the text file. Checkpoint with the owner.

  2. Create text file(s) for testing the page label method. 2A. Include multiple successful uses, that test a wide range of options, and locations. 2B. Include multiple examples of bad uses, that demonstrate syntax checking, error messages, and out of limit values. A bad use should not result in not processing the rest of the file. 2C. Include text that explains the expected results. Checkpoint once with the owner.

  3. Add code to support page labels. Checkpoint once with the owner.

  4. Test, debug, and correct until the text file(s) and the code are good. Checkpoint and release with the owner.

PhilterPaper commented 3 years ago

Pagelabels are what you see in the thumbnail given next to the vertical slider. I presume that's what you're talking about. There's an example showing it in PDF::Builder (examples/050_pagelabels). I don't think anything's been changed since PDF::API2.

Labeling each page at some desired header or footer location is a separate issue. A robust header() and footer() method would be good to have.