1PDF::API2::ViewerPreferUesnecresC(o3n)tributed Perl DocuPmDeFn:t:aAtPiIo2n::ViewerPreferences(3)
2
3
4
6 PDF::API2::ViewerPreferences - How the PDF should be displayed or
7 printed
8
10 $self = $class->new($pdf)
11 Creates a new ViewerPreferences object from a PDF::API2 object.
12
13 %preferences = $self->get_preferences()
14 Returns a hash containing all of the viewer preferences that are
15 defined in the PDF.
16
17 $value = $self->get_preference($name)
18 Returns the value of the specified viewer preference if present, or
19 "undef" if not.
20
21 $self->set_preferences(%values)
22 Sets one or more viewer preferences, as described in the
23 preferences section below.
24
26 Viewer Preferences describe how the document should be presented on
27 screen or in print. Not all PDF viewers will respect these
28 preferences.
29
30 Boolean preferences default to false and take (or return) 0 or 1 as
31 arguments.
32
33 Bounding Box preferences take (or return) one of "media_box",
34 "crop_box", "bleed_box", "trim_box", or "art_box".
35
36 hide_toolbar (boolean)
37 A flag specifying whether to hide the tool bars when the document
38 is active.
39
40 hide_menubar (boolean)
41 A flag specifying whether to hide the menu bar when the document is
42 active.
43
44 hide_window_ui (boolean)
45 A flag specifying whether to hide the user interface elements in
46 the document's window (such as scroll bars and navigation
47 controls), leaving only the document's contents displayed.
48
49 fit_window (boolean)
50 A flag specifying whether to resize the document's window to fit
51 the size of the first displayed page.
52
53 center_window (boolean)
54 A flag specifying whether to position the document's window in the
55 center of the screen.
56
57 display_doc_title (boolean)
58 A flag specifying whether the window's title bar should display the
59 document title taken from the Title entry of the document
60 information directory. If false, the title bar should instead
61 display the name of the PDF file containing the document.
62
63 non_full_screen_page_mode (name)
64 The document's page mode, specifying how to display the document on
65 exiting full-screen mode. Options are the same as "page_mode" in
66 PDF::API2 except that the "attachments" and "full_screen" options
67 aren't supported.
68
69 direction ('l2r' or 'r2l')
70 The predominant reading order for text (left-to-right or right-to-
71 left).
72
73 This entry has no direct effect on the document's contents or page
74 numbering but may be used to determine the relative positioning of
75 pages when displayed side-by-side or printed n-up.
76
77 view_area (bounding box)
78 The name of the page boundary representing the area of a page that
79 shall be displayed when viewing the document on the screen.
80
81 view_clip (bounding box)
82 The name of the page boundary to which the contents of a page shall
83 be clipped when viewing the document on the screen.
84
85 print_area (bounding box)
86 The name of the page boundary representing the area of a page that
87 shall be rendered when printing the document.
88
89 print_clip (bounding box)
90 The name of the page boundary to which the contents of a page shall
91 be clipped when printing the document.
92
93 print_scaling ('none' or 'app_default')
94 The page scaling option that shall be selected when a print dialog
95 is displayed for this document. "none" represents no page scaling,
96 and "app_default" represents the reader's default print scaling.
97
98 duplex ('simplex', 'duplex_short', or 'duplex_long')
99 The paper handling option that shall be used when printing the file
100 from the print dialog. The duplex values represent whether the
101 page should be flipped on its short edge or long edge,
102 respectively.
103
104 pick_tray_by_pdf_size (boolean)
105 A flag specifying whether the PDF page size shall be used to select
106 the input paper tray. This setting influences only the preset
107 values used to populate the print dialog presented by the reader.
108
109 print_page_rage (an array of integer pairs)
110 The page numbers used to initialize the print dialog box when the
111 file is printed. The array shall contain an even number of
112 integers to be interpreted in pairs, with each pair specifying the
113 first and last pages in a sub-range of pages to be printed. The
114 first page of the PDF file shall be denoted by 1.
115
116 num_copies (integer)
117 The number of copies that shall be printed when the print dialog is
118 opened for this file.
119
120
121
122perl v5.36.0 2023-01-20 PDF::API2::ViewerPreferences(3)