extractpdfmark icon indicating copy to clipboard operation
extractpdfmark copied to clipboard

Bookmarks / outline extraction

Open simone-viozzi opened this issue 3 years ago • 3 comments

Hi, I'm able to add an outline to a PDF using pdfmarks, as described here.

For example:

pdfmarks:

[ /Count -3
    /Title (chapter 1)
    /Page 1
    /OUT pdfmark
[ /Title (chapter 1.1)
  /Page 3
  /OUT pdfmark
[ /Count -1
    /Title (chapter 1.2)
    /Page 4
    /OUT pdfmark
[ /Title (chapter 1.2.1)
  /Page 4
  /OUT pdfmark
[ /Count -1
    /Title (chapter 1.3)
    /Page 8
    /OUT pdfmark
[ /Title (chapter 1.3.1)
  /Page 9
  /OUT pdfmark
[ /Title (chapter 2)
  /Page 11
  /OUT pdfmark
[ /Title (chapter 3)
  /Page 30
  /OUT pdfmark
[ /Title (chapter 4)
  /Page 35
  /OUT pdfmark
[ /Title (chapter 5)
  /Page 40
  /OUT pdfmark

and:

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile={output_file}  ./pdfmarks {input_file}

will result in an outline like:

image

Is this program able to extract this type of pdfmarks?

I tried as described in the README, but I got only:

% Extract PDFmark 1.1.1 (with poppler-cpp)
% https://github.com/trueroad/extractpdfmark

[ /PageMode /UseNone /DOCVIEW pdfmark

simone-viozzi avatar Oct 25 '22 20:10 simone-viozzi

As described at the beginning of README.md, Extract PDFmark extracts page mode and named destinations. It cannot extract other things like outlines or bookmarks.

trueroad avatar Oct 27 '22 13:10 trueroad

Is it possible to add this functionality?

simone-viozzi avatar Oct 27 '22 19:10 simone-viozzi

I have no idea. Pull requests are welcome.

trueroad avatar Oct 30 '22 09:10 trueroad