Labels

Milestone

Assignee

3 participants

The WebSubmit file stamper relies on the pdftk tool to process PDF files, but unfortunately pdftk does not preserve bookmarks (eg. table of content or "outlines"), even though it is able to dump them.

Ghostscript could be used instead to stamp files, as it can preserve such information.

Ghostscript could fully replace pdftk in this case, or could be used simply to enrich the resulting stamped file with the necessary instructions to create the bookmarks (PDFMark?), provided that these instructions can be extracted correctly from the original file.

Alternatively a Pythonic version of this method could be implemented using the pyPdf library, in particular the mergePage method. In principle, pyPdf is able to copy over the new PDF all the metadata of the original one, thus it should be possible to also provide the bookmarks.