0

How to attach attribute to a PDF file programmatically, without acrobat or any other reader So that it will opened with Zoom to fit width, I've copied this attribute from Smatra pdf viewer settings file?

By default a file opened in browser with fit width, but in acrobat or other readers as fit page. So its the property of viewer instead of PDF file. I need to change view of a very long height page view.

change in view of Smatra PDF settings by default and for a file

change in zoom view of Smatra PDF settings by default and for a file

  • You are incorrect. It is a property inside the PDF. Now it may not be specified and hence you get the default for a viewer. – Kevin Brown Feb 08 '22 at 17:37

1 Answers1

0

SumatraPDF uses a default FileState for when a new file is opened, Adobe Acrobat does the same.

In both you can change that DefaultZoom = Fit Width via their settings menu. enter image description here

However for re-opening files SumatraPDF "Remembers" the users preference for each file in the Advanced SumatraPDF-settings.txt, so the FileState may be reopened in the next session to over-ride the default i.e. keeping some view settings for re-use. This is essential behaviour for pre-viewing a constantly changing pdf at same zoom whilst editing the contents using say LaTeX. enter image description here

PDF viewers do not have to respect the internal file settings of a PDF (users must have the ultimate user control for accesibility, so can switch it off or change its behaviour in Adobe Reader). enter image description here

A browser can be instructed to fit width using the external hash tag.pdf#FitWidth but again a user can change the toolbar or other interface settings to their choice by adding or removing such directives.

Both SumatraPDF and Acrobat can receive similar user command line instructions when opening a file.

Adobe Acrobat will optionally respect the settings Adobe PRO or similar PDF writer has stored within the PDF and may use those to over-ride its initial default settings (except when doubly over-riden by the user).

So using a programmable library you can set any view setting default it supports but many readers may not (and dont have to) obey that internal Adobe behaviour.

K J
  • 8,045
  • 3
  • 14
  • 36