9

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 http://www.mediafire.com/file/b0ld7aq1ulq9uk3/1.pdf, in case that you may wonder what is special about it.

Thanks and regards!

Linker3000
  • 27,498
  • 3
  • 52
  • 73
Tim
  • 16,963
  • 69
  • 181
  • 260

4 Answers4

10

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>>
 endobj

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....

Update:

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.

Kurt Pfeifle
  • 12,411
  • 2
  • 54
  • 71
  • 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 03: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 07: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
  • @Tim: My commandline works. It changes your viewing/zooming problem. Are you on Windows or on Linux? Which version exactly? – Kurt Pfeifle Jul 22 '11 at 13:11
  • I am in Ubuntu 10.10. – Tim Jul 22 '11 at 13:13
  • @Tim: Here's one additional trick you could apply. Locate the download resource of the `qpdf` utility on the internet. (AFAIR, it may be on *qpdf.sf.net*.) Install it (it works standalone as a simple exe). Then run `qpdf --qdf in.pdf out.pdf`. This will unpack some of the PDF object streams, and it will re-write the ASCII parts to make it better readable. Then apply the sed line on this `out.pdf`. You can also open the out.pdf in an editor an look for the `/Fit` spots. – Kurt Pfeifle Jul 22 '11 at 13:17
  • @Tim: On Ubuntu simply run `sudo apt-get install qpdf`. – Kurt Pfeifle Jul 22 '11 at 13:18
  • Thanks! It works! I wonder now if it is possible to compress the converted file back to small size? – Tim Jul 22 '11 at 13:27
  • 2
    @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](http://unix.stackexchange.com/q/17220).) – Gilles 'SO- stop being evil' Jul 22 '11 at 13:50
  • @pipitas: I was also wondering how to learn to understand pdf code? – Tim Jul 22 '11 at 13:53
  • @Gilles: Depending on on the end-of-line convention used in the PDF, and on the OS you are on, my command also works. However, I admit: your command will always work. It was my mistake not think about this possibility... – Kurt Pfeifle Jul 22 '11 at 16:40
  • @Tim: Start by reading+studying http://www.gnupdf.org/Introduction_to_PDF first, then continue with http://www.mactech.com/articles/mactech/Vol.15/15.09/PDFIntro/index.html and lastly http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf . An little bit of knowledge about PostScript programming also works well to understand PDF faster. – Kurt Pfeifle Jul 22 '11 at 16:46
  • qpdf and sed together worked, albeit changed file size from 9 MB to 25 MB. – hgajshb Dec 09 '19 at 14:03
  • @yanglifu90: You most likely can can re-compress the PDF again, also using QPDF: `'qpdf expanded.pdf compressed.pdf'`... – Kurt Pfeifle Dec 09 '19 at 14:27
  • @KurtPfeifle @Gilles 'SO- stop being evil' note the sed -b switch to preserve line endings `sed -b 's#/Fit#/XYZ#g' in.pdf > out.pdf` (necessary on Cygwin) – Robb Hoff Jul 02 '21 at 09:13
  • 1
    @RobHoff That would be a Cygwin-specific thing. Other versions of sed don't even have a `-b` switch, and it would do nothing. – Gilles 'SO- stop being evil' Jul 02 '21 at 11:12
2

open the document, go to thumbnail view, select all the pages, right click for page properties, choose action tab click add button, choose view>zoom>fit to height, close

go to bookmark view. click on bookmarks and page view is default for all

Valarie
  • 21
  • 1
0

Setting the Bookmarks > Properties to Zoom = Fit Height worked. However, I also had issues when PDF links would expand the zoom % to "custom." Although the Bookmark/Properties fixed the issue for the most part, I could see that after clicking the link, the view would adjust itself from large/custom to the fit height setting. The flicker that this caused was unnecessary and bothersome.

I fixed it by editing each link in the Action tab and then clicking Edit, then editin the Zoom to Fit Height. Save each link.

0

I would like to share how could I change zoom settings for all bookmarks for my own preferences in Adobe Acrobat Reader 2022. Decision turn out pretty simple and without using any plug-ins and pay money for it. First of all we need to open all bookmarks(top and sub-level bookmarks must be visible in panel), further activate cursor on this panel and press standard combination keys Ctrl+A for select all bookmarks. Selecting process may will take a few seconds, further choose bookmarks properties(right click of any selected bookmark) and choose Actions -> Edit -> Zoom(choose zoom preference). Futher press OK, surely you must save this PDF with new settings zoom and name. If you then open new PDF and click any bookmarks in left panel it have zoom which right for you. Most of PDF's have no problem with choose zoom settings for all bookmarks, but some don't let do it, available settings for only one bookmark per time. It very annoying to set every bookmark and may will take a lot of time, but my way let to change zoom for all bookmarks at one time.