PDF Functions

Table of Contents

Dump Bookmarks

This uses PDFTK to dump bookmarks (so it's not compatible with cpdf).

function pdfbookmarks -d "Dump bookmarks from a PDF (pdftk format)" --argument-names SOURCEFILE OUTFILE
    if set --query OUTFILE
        set OUTFILE "bookmarks.txt"
    end
    pdftk $SOURCEFILE dump_data_utf8 output $OUTFILE
end

See the PDF TK section of the Tealdeer post for (a little) more information.