ExifTool Forum

General => Metadata => Topic started by: ebulerdo on January 04, 2019, 07:13:34 AM

Title: Open to page setting in PDF
Post by: ebulerdo on January 04, 2019, 07:13:34 AM
Good morning All.

In PDF files you can set the page that will be displayed when the PDF is open. You can modify that setting with Acrobat at File > Properties > Initial View > Open to page.

I'm looking for the metadata that controls that setting. I work with hundreds of PDF files and I'm looking for a way to automate that process instead of manually changing the setting file by file.

Do you have an idea of where that setting is stored?

Thanks!


Title: Re: Open to page setting in PDF
Post by: Phil Harvey on January 04, 2019, 07:17:00 AM
You can use ExifTool to compare the metadata before and after you write this with Acrobat.  If it doesn't show up in the regular metadata, try using the -v3 option.

- Phil

Edit:  I tried this myself and found this difference with the -v3 output:

  | + [OpenAction directory with 2 entries]
  | | 0)  D = [ref(8 0 R),/XYZ,null,null,null]
  | |     - Tag 'D', direct array of 5 objects
  | | 1)  S = /GoTo
  | |     - Tag 'S', direct object


  | + [OpenAction directory with 2 entries]
  | | 0)  D = [ref(11 0 R),/XYZ,null,null,null]
  | |     - Tag 'D', direct array of 5 objects
  | | 1)  S = /GoTo
  | |     - Tag 'S', direct object


So the OpenAction "D" property is an array, with the first element being a reference to the "Open to page" page object.

And from the PDFReference documentation, the array is of the form:

[page,/XYZ,left,top,zoom]

Display the page designated by page, with the coordinates (left, top) positioned at the upper-left corner of the window and the contents of the page magnified by the factor zoom. A null value for any of the parameters left, top, or zoom specifies that the current value of that parameter is to be retained unchanged. A zoom value of 0 has the same meaning as a null value.

- Phil
Title: Re: Open to page setting in PDF
Post by: ebulerdo on January 04, 2019, 07:27:47 AM
Thank you very much!

I had been comparing the files, but there were no differences other than time. Thanks for the suggestion to use -v3.

Have a nice day!