trueroad / extractpdfmark

Extract PDFmark can extract page mode and named destinations as PDFmark from PDF.
GNU General Public License v3.0
16 stars 2 forks source link

Bookmarks / outline extraction #4

Open simone-viozzi opened 1 year ago

simone-viozzi commented 1 year ago

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
trueroad commented 1 year ago

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.

simone-viozzi commented 1 year ago

Is it possible to add this functionality?

trueroad commented 1 year ago

I have no idea. Pull requests are welcome.