Zooming size of pdf files and bookmarks

7,029

Solution 1

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.

Solution 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

Share:
7,029

Related videos on Youtube

baz
Author by

baz

Elitists are oppressive, anti-intellectual, ultra-conservative, and cancerous to the society, environment, and humanity. Please help make Stack Exchange a better place. Expose elite supremacy, elitist brutality, and moderation injustice to https://stackoverflow.com/contact (complicit community managers), in comments, to meta, outside Stack Exchange, and by legal actions. Push back and don't let them normalize their behaviors. Changes always happen from the bottom up. Thank you very much! Just a curious self learner. Almost always upvote replies. Thanks for enlightenment! Meanwhile, Corruption and abuses have been rampantly coming from elitists. Supportive comments have been removed and attacks are kept to control the direction of discourse. Outright vicious comments have been removed only to conceal atrocities. Systematic discrimination has been made into policies. Countless users have been harassed, persecuted, and suffocated. Q&amp;A sites are for everyone to learn and grow, not for elitists to indulge abusive oppression, and cover up for each other. https://softwareengineering.stackexchange.com/posts/419086/revisions https://math.meta.stackexchange.com/q/32539/ (https://i.stack.imgur.com/4knYh.png) and https://math.meta.stackexchange.com/q/32548/ (https://i.stack.imgur.com/9gaZ2.png) https://meta.stackexchange.com/posts/353417/timeline (The moderators defended continuous harassment comments showing no reading and understanding of my post) https://cs.stackexchange.com/posts/125651/timeline (a PLT academic had trouble with the books I am reading and disparaged my self learning posts, and a moderator with long abusive history added more insults.) https://stackoverflow.com/posts/61679659/revisions (homework libels) Much more that have happened.

Updated on September 18, 2022

Comments

  • baz
    baz almost 2 years

    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!

  • baz
    baz almost 13 years
    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!
  • Kurt Pfeifle
    Kurt Pfeifle almost 13 years
    @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 /)....
  • baz
    baz almost 13 years
    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?
  • baz
    baz almost 13 years
    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.
  • baz
    baz almost 13 years
    I am in Ubuntu 10.10.
  • Kurt Pfeifle
    Kurt Pfeifle almost 13 years
    @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
    Kurt Pfeifle almost 13 years
    @Tim: On Ubuntu simply run sudo apt-get install qpdf.
  • baz
    baz almost 13 years
    Thanks! It works! I wonder now if it is possible to compress the converted file back to small size?
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' almost 13 years
    @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.)
  • Kurt Pfeifle
    Kurt Pfeifle almost 13 years
    @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
    Kurt Pfeifle almost 13 years
    @Tim: Start by reading+studying gnupdf.org/Introduction_to_PDF first, then continue with mactech.com/articles/mactech/Vol.15/15.09/PDFIntro/index.htm‌​l and lastly adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/… . An little bit of knowledge about PostScript programming also works well to understand PDF faster.
  • snr
    snr over 5 years
    it works as expected
  • hgajshb
    hgajshb over 4 years
    qpdf and sed together worked, albeit changed file size from 9 MB to 25 MB.
  • Kurt Pfeifle
    Kurt Pfeifle over 4 years
    @yanglifu90: You most likely can can re-compress the PDF again, also using QPDF: 'qpdf expanded.pdf compressed.pdf'...
  • Rob Hoff
    Rob Hoff almost 3 years
    @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)
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' almost 3 years
    @RobHoff That would be a Cygwin-specific thing. Other versions of sed don't even have a -b switch, and it would do nothing.