Scroll to navigation

PDF::API2::ViewerPreferences(3) User Contributed Perl Documentation PDF::API2::ViewerPreferences(3)

NAME

PDF::API2::ViewerPreferences - How the PDF should be displayed or printed

METHODS

$self = $class->new($pdf)
Creates a new ViewerPreferences object from a PDF::API2 object.
%preferences = $self->get_preferences()
Returns a hash containing all of the viewer preferences that are defined in the PDF.
$value = $self->get_preference($name)
Returns the value of the specified viewer preference if present, or "undef" if not.
$self->set_preferences(%values)
Sets one or more viewer preferences, as described in the preferences section below.

PREFERENCES

Viewer Preferences describe how the document should be presented on screen or in print. Not all PDF viewers will respect these preferences.

Boolean preferences default to false and take (or return) 0 or 1 as arguments.

Bounding Box preferences take (or return) one of "media_box", "crop_box", "bleed_box", "trim_box", or "art_box".

A flag specifying whether to hide the tool bars when the document is active.
A flag specifying whether to hide the menu bar when the document is active.
A flag specifying whether to hide the user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed.
A flag specifying whether to resize the document's window to fit the size of the first displayed page.
A flag specifying whether to position the document's window in the center of the screen.
A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information directory. If false, the title bar should instead display the name of the PDF file containing the document.
The document's page mode, specifying how to display the document on exiting full-screen mode. Options are the same as "page_mode" in PDF::API2 except that the "attachments" and "full_screen" options aren't supported.
The predominant reading order for text (left-to-right or right-to-left).

This entry has no direct effect on the document's contents or page numbering but may be used to determine the relative positioning of pages when displayed side-by-side or printed n-up.

The name of the page boundary representing the area of a page that shall be displayed when viewing the document on the screen.
The name of the page boundary to which the contents of a page shall be clipped when viewing the document on the screen.
The name of the page boundary representing the area of a page that shall be rendered when printing the document.
The name of the page boundary to which the contents of a page shall be clipped when printing the document.
The page scaling option that shall be selected when a print dialog is displayed for this document. "none" represents no page scaling, and "app_default" represents the reader's default print scaling.
The paper handling option that shall be used when printing the file from the print dialog. The duplex values represent whether the page should be flipped on its short edge or long edge, respectively.
A flag specifying whether the PDF page size shall be used to select the input paper tray. This setting influences only the preset values used to populate the print dialog presented by the reader.
The page numbers used to initialize the print dialog box when the file is printed. The array shall contain an even number of integers to be interpreted in pairs, with each pair specifying the first and last pages in a sub-range of pages to be printed. The first page of the PDF file shall be denoted by 1.
The number of copies that shall be printed when the print dialog is opened for this file.
2024-06-23 perl v5.40.0