squirly has asked for the wisdom of the Perl Monks concerning the following question:
Hi All, looking for a way of reading the Page Label from a PDF in Perl; and if that's not possible then a way of adding / reading metadata.
Problem I'm working to solve is that I'm using a PDF file as a 'template', and then reading in another file of 'data', and then based on the dynamic data, the script is keyed to extract a page from the template and insert into a new pdf (each template page being potentially recycled n times for each completed output pdf).
This is working, and for proof of concept I keyed the script to use page_numbers (page 1 is a basic contents page template, page 2 is a legaleaze disclaimer page that is added at the end of a set of pages for each member for example) in the template pdf, however I need a way of expressing to the script which pages are which for the eventual production environment; they won't always be arbitrary page 1 = this, page 2 = this; sometimes the template may have up to six different pages, each with a different purpose.
Was thinking an easy way of addressing this was to give each page a label and then keying the script off of the label names, however I can't figure out how to extract the page label from the input pdf template; only how to set a label.
Currently using the PDF::API2 library, however am open to using any library in order to read and extra the page_label=page_number information (that'll be stored in an eventual hash / associative array).
Appreciate any and all assistance, and I apologize for rudimentary post, it's my first attempt reaching out.
Thank you!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading page label (name) from PDF file...
by poj (Abbot) on May 25, 2016 at 06:38 UTC | |
by Anonymous Monk on May 25, 2016 at 18:14 UTC |