How to make bookmark targets fitwidth?

Viewed 39

I want to make the targets of bookmarks fitwidth. I don't see there is such option in pdftk and cpdf. Is this possible with these tools? Or some other tools provide this feature?

1 Answers

Yes but not always applied the same in all viewers. However it should be possible to set a preferred page wide strip near top of page. Here we see effect in Acrobat on clicking single bookmark.

enter image description here

I dont think PDFtk is that refined however in cpdf format output is
0 "FitWidth" 1 "[1/FitBH 792]"
Note:- read the manual however the first 0 may need to be 1 or more but the rest should be similar Here is an example using the manual to alter 6 to 6.0 and zoom fit width to top of page (page height in this case is 666) and fit width works in Acrobat or some other readers, but only top of page in others like Edge.

enter image description here

  1. Note that ALL existing bookmarks need export first.
cpdf -list-bookmarks -utf8 "cpdfmanual - Copy.pdf" >bookmarks.txt
  1. make edits enter image description here

  2. Reapply ALL bookmarks

cpdf -add-bookmarks bookmarks.txt "cpdfmanual - Copy.pdf" -o "cpdfmanual - Modified.pdf"

Note not working in current Edge or many other browsers and that with Chrome/ium represents the web majority.

enter image description here

However for browsers you can send URL.pdf#fragment(task=value)
bookmark_targets_fitwidth.pdf#view=FitH

enter image description here

Related