If I open a PDF document in Adobe Reader, it usually opens with Fit Width page zoom by default.
But if I click on a bookmark, the zoom changes to Fit Page.
How do I stop this from happening and have Adobe Reader maintain the default zoom?
If I open a PDF document in Adobe Reader, it usually opens with Fit Width page zoom by default.
But if I click on a bookmark, the zoom changes to Fit Page.
How do I stop this from happening and have Adobe Reader maintain the default zoom?
In Foxit Reader, there is a Preference Setting... (File -> Preferences )..
Adobe Reader may have similar functionality.. OR use Foxit Reader... which is a great pdf viewer.
Choose: Page Display, in the Left Pane.
Then "Check" Forbid the Change of the current Zoom factor.
This will preserve the Current Zoom when moving around with BookMarks.
Hope this helps..
Please Note Foxit PDF Reader is FREE!!! and you can download from this link: https://www.foxit.com/pdf-reader/
At time of installation, you can uncheck any recommendation the software is trying to add (e.g. browser plugins, antivirus, etc.)
Sorry in advance if I'm breaking any rules here. I don't have enough reputation points to give this answer an up arrow, but I thought people deserved to know that this worked for me--like a charm!
From above:
"The way to do it is, edit the afflicted PDF files themselves. Open each malfunctioning file in a hex editor (I recommend "HxD" because it's free; search for it), and do this replace globally:
/Fit
->/XYZ
, then save the file with a new name.
Voilà, problem will be fixed; the document will then retain whatever zoom setting you set in Adobe Reader settings, no matter how many bookmarks you click."
In what rational universe must I have "reputation points" to share my success with others and help them to resolve this question that has clearly daunted so many?
/Fit
→ /XYZ
after decompressing the PDF with mutool clean -gggglsdfi ORIGINAL.pdf EXPANDED.pdf
worked well for me.
Jan 14 at 11:44
/Fit
→ /XYZ
breaks bookmarks on some PDF viewers (like firefox 121’s built in pdfjs), b/c /XYZ
is supposed to take 3 arguments: /XYZ left top zoom
& /Fit
takes none. you can avoid this by changing /Fit
→ /XYZ null null null
(null means "keep the current values" here) but since this lengthens each bookmark, you won't be able to use a hex editor (I used emacs) & should repair the PDF afterwards w/ something like mutool clean -gggglsdfiz FIT.pdf XYZ.pdf
Jan 14 at 13:47
If you cannot change this behavior by fiddling with Edit/Preference/Page Display/Zoom settings, then you may well have the case of the bookmark being tied to an "Action".
Unfortunately, you cannot change that with Acrobat Reader -- you'd need access to Adobe Acrobat or to Acrobat Professional (or maybe some other tool with similar capabilities in this respect).
Here are some screenshots which illustrate what I mean:
Right-click the bookmark and move mouse pointer to "Properties..." on lower end of context menu...
...and the dialog to edit/add/delete "Actions" appears
page target
of all the bookmarks into one. I'm not sure if this is also true for you?
FYI, this can happen even if the Bookmark link has no "Zoom level" action. In my case (Acrobat Pro 9.5.5), it happened because each Bookmark links to a Destination, and the Destinations themselves apparently have the Fit Width zoom level.
I verified this by double clicking on a Destination (from the Destinations navigation panel) to open it, changing my zoom settings to Fit Page, then right clicking on the Destination and selecting Set Destination. Afterward, that particular bookmark resulted in Fit Page while the others still resulted in Fit Width.
I solved this with a nifty plugin PubHelper, which is no longer maintained but worked for me: https://web.archive.org/web/20150814072039/http://pubhelper.blogspot.com/ . I selected all bookmarks, then PubHelper->Bookmarks->To Inherit Zoom.
BTW, I don't think this issue is specific to "Fit Width" being chosen. I think it's a general issue where bookmarks can override the user's current zoom settings.
To disable the Hand tool from following an article path, go to the the Edit menu and choose Preferences. In the General category, uncheck "Make Hand tool read articles".
This still seems to be a problem in 2020 and I didn't want to install java for the above solution.
So for the next person that comes across this, you can rid the bookmark of its saved zoom by setting each of the bookmarks zoom factor to 0, or some other float to enforce some other zoom factor.
I made a python script which seems to do the job on the few pdf's that I've tested with. It requires pikepdf from pip.
import pikepdf,sys,os,argparse
class data:
_names = None
def update_dest(zoom_factor,current):
dest = pikepdf.Array()
dest.append(current[0])
dest.append(pikepdf.Name("/XYZ"))
dest.append(0)
dest.append(0)
dest.append(zoom_factor)
dest_type = current[1]
if dest_type == "/XYZ":
dest[2] = current[2]
dest[3] = current[3]
elif dest_type in ("/FitH","FitBH"):
dest[3] = current[2]
elif dest_type in ("/FitV","FitBV"):
dest[2] = current[2]
elif dest_type == "/FitR":
dest[2] = current[2]
dest[3] = current[4]
#("/Fit","/FitB"):
return dest
def collect_all_names(root):
if not hasattr(root,"Names"):
return {}
names = {}
def _apply_collect_all_names(parent):
if hasattr(parent,"Kids"):
for item in parent.Kids:
_apply_collect_all_names(item)
elif hasattr(parent,"Names"):
for index in range(0,len(parent.Names),2):
names[parent.Names[index]] = (index+1,parent.Names)
_apply_collect_all_names(root.Names.Dests)
return names
def get_names(root):
if not data._names:
data._names = collect_all_names(root)
return data._names
def set_zoom_factor(root,depth,outline_item,zoom_factor,only_bookmarks):
skipped = False
if outline_item.action:
outline_item.action.D = update_dest(zoom_factor,outline_item.action.D)
elif outline_item.destination != None:
if only_bookmarks:
names = get_names(root)
if outline_item.destination in names:
index = names[outline_item.destination][0]
array = names[outline_item.destination][1]
array[index] = update_dest(zoom_factor,array[index])
else:
raise RuntimeError("Name %s Not Found" % outline_item.destination)
else:
skipped = True
print(("skipped" if skipped else "updated") + " >> %s %s" % (" "*depth,outline_item.title))
def set_all_bookmark_zooms(in_file,out_file=None,zoom_factor=None,only_bookmarks=False):
def _apply_set_all_bookmark_zoom(names,depth,children):
for child in children:
set_zoom_factor(names,depth,child,zoom_factor,only_bookmarks)
_apply_set_all_bookmark_zoom(names,depth+1,child.children)
pdf = pikepdf.open(in_file)
if not only_bookmarks:
names = get_names(pdf.root)
for key,values in names.items():
index,array = values
array[index] = update_dest(zoom_factor,array[index])
with pdf.open_outline() as outline:
_apply_set_all_bookmark_zoom(pdf.root,0,outline.root)
save_name = out_file if out_file else in_file.split(".")[0] + "-zoomed.pdf"
print("saving %s ..." % save_name)
pdf.save(save_name)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Remove PDF bookmark zooms')
parser.add_argument('-z','--zoom', type=float,default=None,
help='set the zoom factor of the bookmarks/links. 0 will inherit the current zoom (default:0)')
parser.add_argument('-ob','--only_bookmarks',default=False,action="store_true",
help='only process bookmark links, other clickables in the document are left untouched (default:False)')
parser.add_argument('file_name',help='PDF filename to process')
parser.add_argument('-o','--out_file',default=None,help='Output filename')
args = parser.parse_args()
set_all_bookmark_zooms(args.file_name,args.out_file,args.zoom,args.only_bookmarks)
Re "[How can I ] Prevent Adobe Reader from switching to “Fit Page” zoom when bookmark is clicked[?]": There is a way to do that, yes, but not from within Adobe reader settings. (To the best of my knowledge, Adobe Reader has never had that functionality and never will.) The way to do it is, edit the afflicted PDF files themselves. Open each malfunctioning file in a hex editor (I recommend "HxD" because it's free; google for it), and do this replace globally: "/Fit" -> "/XYZ", then save the file with a new name. Voila, problem will be fixed; the document will then retain whatever zoom setting you set in Adobe Reader settings, no matter how many bookmarks you click.
/Fit
with /FitH
as above. there are a few other ways bookmarks can be opened (such as "Fit height"), which are given in section 12.3.2.2, “Explicit Destinations”, of the PDF standard. that link goes to the standard for PDF 1.7 that Adobe hosts; you can also download the latest standard from pdfa.org/resource/iso-32000-pdf
Jan 14 at 13:48
/Fit
→ /XYZ
breaks bookmarks on some PDF viewers (like firefox 121’s built in pdfjs), b/c /XYZ
is supposed to take 3 arguments: /XYZ left top zoom
& /Fit
takes none. you can avoid this by changing /Fit
→ /XYZ null null null
(null means "keep the current values" here) but since this lengthens each bookmark, you won't be able to use a hex editor (I used emacs) & should repair the PDF afterwards w/ something like mutool clean -gggglsdfiz FIT.pdf XYZ.pdf
Jan 14 at 13:50
Since the August 2020 release of Acrobat (release notes):
Acrobat now provides an option in the bookmark properties to retain the destination page number when you adjust the zoom level of multiple bookmarks.
I have created an open-source (Java-based) app that allows you to apply
to all bookmarks within a PDF document or recursively to entire directories of PDFs without selecting each item manually:
Solution for Adobe Acrobat Reader 2021
Run the following sed command on the pdf file (i.e. you need to do this for each pdf file that you want this change, in the free Acrobat Reader there is no setting to fix this). The command replaces instances in the bookmark code from /Fit
to /XYZ
. On Windows you can run it on Cygwin (in the Cygwin setup install the sed
package)
sed -b 's#/Fit#/XYZ#g' original.pdf > modified.pdf