Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When reading pdf files using either adobe reader or evince, the zooming size always change back to default whenever the bookmarks are clicked. I was wondering if it is possible that the zooming size is set once for all during the same viewing session?

My pdf file can be downloaded from here, in case that you may wonder what is special about it.

Thanks and regards!

share|improve this question

1 Answer 1

up vote 5 down vote accepted

No, it does not change back to 'default', whenever the bookmarks are clicked. It changes back to 'Fit page to window'.

Why is this?

And it does so, because each of the bookmarks is defined with an additional parameter to do exactly this. In your PDF's code this is equivalent to this snippet:

 7319 0 obj 
    <</D [1457 0 R /Fit] /S /GoTo>>

It's the /Fit part of the snippet where the /GoTo action tells the viewer to render the destination page (specified by /D) which the file holds in object 1457 0 obj as 'Fit to window'...

How can you change this?

Not without any modification to the PDF file itself. You cannot setup your viewer to ignore these instructions which are in the PDF code (at least I'm not aware of any viewer that does allow this...).

So you have to edit your bookmarks in your PDF file.

With Adobe Acrobat Pro you can do this by right-clicking on a bookmark, selecting Properties... from the popped-up context menu and changing the 'zoom' for that bookmark from 'Fit page to window' to '$whateveryouprefer'.

There may be other PDF editors (Foxit Reader is a good guess) which also allow bookmark editing, but I'm not familiar enough with these to tell for sure without looking it up....


If you dare, you can open your PDF in a text or hex editor. Search for all spots which contain /Fit. Change these to /XYZ (Attention, there are more than 600 of these in your file -- if you are familiar with sed, the stream editor, you could use that tool as well). That will cause Acrobat Reader to keep the current zoom factor when jumping to the target after clicking a bookmark.

share|improve this answer
Thanks! Is the sed command in your update used like sed s/\/Fit/\/XYZ/ < 1.pdf > 2.pdf? Why do I get this error "sed: -e expression #1, char 8: unknown option to `s'"? Thanks! – Tim Jul 22 '11 at 3:17
@Tim: Try it like this: sed 's#/Fit#/XYZ#' in.pdf > out.pdf. Sed allows you to use any character as the separator. I prefer # because I find it's better readable (and it avoids the need to escape the /).... – Kurt Pfeifle Jul 22 '11 at 7:48
Thanks! Both of mine and yours don't change the original zooming problem. I was wondering if sed can work on pdf files as if they were plain text? – Tim Jul 22 '11 at 11:56
I also wonder how you viewed the pdf file to see the snippet? I use gedit, but cannot find a proper encoding method to decode the content. – Tim Jul 22 '11 at 12:14
@pipitas That should be sed 's#/Fit#/XYZ#g' in.pdf > out.pdf, otherwise only the first occurrence on each line is replaced (and lines are meaningless in a PDF file). (See How to view and edit the code of a pdf file.) – Gilles Jul 22 '11 at 13:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.