12.2 查看器首选项¶
12.2 Viewer Preferences
文档目录中的 ViewerPreferences 条目(见7.7.2“文档目录”)指定了一个查看器首选项字典(PDF 1.2),用于控制文档在屏幕上或打印时的呈现方式。如果没有指定这样的字典,符合标准的阅读器应按照其当前的用户首选项设置来运行。表 150 显示了查看器首选项字典的内容。
键 | 类型 | 值 |
---|---|---|
HideToolbar | 布尔值 | (可选)一个标志,用于指定当文档处于活动状态时是否隐藏符合标准的阅读器的工具栏。默认值:false。 |
HideMenubar | 布尔值 | (可选)一个标志,用于指定当文档处于活动状态时是否隐藏符合标准的阅读器的菜单栏。默认值:false。 |
HideWindowUI | 布尔值 | (可选)一个标志,用于指定是否隐藏文档窗口中的用户界面元素(如滚动条和导航控件),仅显示文档内容。默认值:false。 |
FitWindow | 布尔值 | (可选)一个标志,用于指定是否调整文档窗口的大小以适应第一页的尺寸。默认值:false。 |
CenterWindow | 布尔值 | (可选)一个标志,用于指定是否将文档窗口置于屏幕中央。默认值:false。 |
DisplayDocTitle | 布尔值 | (可选;PDF 1.4)一个标志,用于指定窗口的标题栏是否应显示从文档信息字典的 Title 条目中获取的文档标题(见14.3.3“文档信息字典”)。如果为 false,则标题栏应显示包含文档的 PDF 文件的名称。默认值:false。 |
NonFullScreenPageMode | 名称 | (可选)文档的页面模式,指定退出全屏模式时如何显示文档:
|
Direction | 名称 |
(可选;PDF 1.3)文本的主要阅读顺序:
|
ViewArea | 名称 | (可选;PDF 1.4)表示在屏幕上查看文档时应显示页面区域的页面边界名称。该值是在页面对象中指定相关页面边界的键(见7.7.3“页面树”和14.11.2“页面边界”)。如果页面对象中未定义指定的页面边界,则应使用其默认值,如表 30 所示。默认值:CropBox。 此条目主要用于预印前应用程序,这些应用程序按照14.11.2“页面边界”中所述解释或操作页面边界。 注 1 大多数符合标准的阅读器会忽略它。 |
ViewClip | 名称 | (可选;PDF 1.4)表示在屏幕上查看文档时页面内容应裁剪到的页面边界名称。该值是在页面对象中指定相关页面边界的键(见7.7.3“页面树”和14.11.2“页面边界”)。如果页面对象中未定义指定的页面边界,则应使用其默认值,如表 30所示。默认值:CropBox。 此条目主要用于预印前应用程序,这些应用程序按照14.11.2“页面边界”中所述解释或操作页面边界。 注 2 大多数符合标准的阅读器会忽略它。 |
PrintArea | 名称 | (可选;PDF 1.4)表示在屏幕上查看文档时页面内容应裁剪到的页面边界名称。(此处文档可能有误,按前文逻辑推测为打印时的情况)该值是在页面对象中指定相关页面边界的键(见7.7.3“页面树”和14.11.2“页面边界”)。如果页面对象中未定义指定的页面边界,则应使用其默认值,如表 30所示。默认值:CropBox。 此条目主要用于预印前应用程序,这些应用程序按照14.11.2“页面边界”中所述解释或操作页面边界。 注 3 大多数符合标准的阅读器会忽略它。 |
PrintClip | 名称 | (可选;PDF 1.4)表示在屏幕上查看文档时页面内容应裁剪到的页面边界名称。(此处文档可能有误,按前文逻辑推测为打印时的情况)该值是在页面对象中指定相关页面边界的键(见7.7.3“页面树”和14.11.2“页面边界”)。如果页面对象中未定义指定的页面边界,则应使用其默认值,如表 30所示。默认值:CropBox。 此条目主要用于预印前应用程序,这些应用程序按照14.11.2“页面边界”中所述解释或操作页面边界。 注 4 大多数符合标准的阅读器会忽略它。 |
PrintScaling | 名称 | (可选;PDF 1.6)当为该文档显示打印对话框时应选择的页面缩放选项。有效值为 None(表示不进行页面缩放)和 AppDefault(表示符合标准的阅读器的默认打印缩放)。如果此条目具有无法识别的值,则应使用 AppDefault。默认值:AppDefault。 如果打印对话框被抑制且其参数从其他来源提供,此条目仍应被遵守。 |
Duplex | 名称 | (可选;PDF 1.7)从打印对话框打印文件时应使用的纸张处理选项。以下值有效:
|
PickTrayByPDFSize | 布尔值 | (可选;PDF 1.7)一个标志,用于指定是否使用 PDF 页面大小来选择输入纸盒。此设置仅影响符合标准的阅读器所显示的打印对话框中使用的预设值。如果 PickTrayByPDFSize 为 true,则打印对话框中与输入纸盒相关的复选框将被选中。 此设置对于不支持按尺寸选择输入纸盒的操作系统无效。 默认值:由符合标准的阅读器定义 |
PrintPageRange | 数组 | (可选;PDF 1.7)打印文件时用于初始化打印对话框的页码。该数组应包含偶数个整数,这些整数应成对解释,每对指定要打印的页面子范围的起始页和结束页。PDF 文件的第一页用 1 表示。默认值:由符合标准的阅读器定义 |
NumCopies | 整数 | (可选;PDF 1.7)打开此文件的打印对话框时应打印的份数。超出范围的值将被忽略。 默认值:由符合标准的阅读器定义,但通常为 1 |
The ViewerPreferences entry in a document’s catalogue (see 7.7.2, “Document Catalog”) designates a viewer preferences dictionary (PDF 1.2) controlling the way the document shall be presented on the screen or in print. If no such dictionary is specified, conforming readers should behave in accordance with their own current user preference settings. Table 150 shows the contents of the viewer preferences dictionary.
Key | Type | Value |
---|---|---|
HideToolbar | boolean | (Optional) A flag specifying whether to hide the conforming reader’s tool bars when the document is active. Default value: false. |
HideMenubar | boolean | (Optional) A flag specifying whether to hide the conforming reader’s menu bars when the document is active. Default value: false. |
HideWindowUI | boolean | (Optional) A flag specifying whether to hide user interface elements in the document’s window (such as scroll bars and navigation controls), leaving only the document’s contents displayed. Default value: false. |
FitWindow | boolean | (Optional) A flag specifying whether to resize the document’s window to fit the size of the first displayed page. Default value: false. |
CenterWindow | boolean | (Optional) A flag specifying whether to position the document’s window in the center of the screen. Default value: false. |
DisplayDocTitle | boolean | (Optional; PDF 1.4) A flag specifying whether the window’s title bar should display the document title taken from the Title entry of the document information dictionary (see 14.3.3, “Document Information Dictionary”). If false, the title bar should instead display the name of the PDF file containing the document. Default value: false. |
NonFullScreenPageMode | name | (Optional) The document’s page mode, specifying how to display the document on exiting full-screen mode:
|
Direction | name |
(Optional; PDF 1.3) The predominant reading order for text:
|
ViewArea | name | (Optional; PDF 1.4) The name of the page boundary representing the area of a page that shall be displayed when viewing the document on the screen. The value is the key designating the relevant page boundary in the page object (see 7.7.3, “Page Tree” and 14.11.2, “Page Boundaries”). If the specified page boundary is not defined in the page object, its default value shall be used, as specified in Table 30. Default value: CropBox. This entry is intended primarily for use by prepress applications that interpret or manipulate the page boundaries as described in 14.11.2, “Page Boundaries.” NOTE 1 Most conforming readers disregard it. |
ViewClip | name | (Optional; PDF 1.4) The name of the page boundary to which the contents of a page shall be clipped when viewing the document on the screen. The value is the key designating the relevant page boundary in the page object (see 7.7.3, “Page Tree” and 14.11.2, “Page Boundaries”). If the specified page boundary is not defined in the page object, its default value shall be used, as specified in Table 30. Default value: CropBox. This entry is intended primarily for use by prepress applications that interpret or manipulate the page boundaries as described in 14.11.2, “Page Boundaries.” NOTE 2 Most conforming readers disregard it. |
PrintArea | name | (Optional; PDF 1.4) The name of the page boundary to which the contents of a page shall be clipped when viewing the document on the screen. The value is the key designating the relevant page boundary in the page object (see 7.7.3, “Page Tree” and 14.11.2, “Page Boundaries”). If the specified page boundary is not defined in the page object, its default value shall be used, as specified in Table 30. Default value: CropBox. This entry is intended primarily for use by prepress applications that interpret or manipulate the page boundaries as described in 14.11.2, “Page Boundaries.” NOTE 3 Most conforming readers disregard it. |
PrintClip | name | (Optional; PDF 1.4) The name of the page boundary to which the contents of a page shall be clipped when viewing the document on the screen. The value is the key designating the relevant page boundary in the page object (see 7.7.3, “Page Tree” and 14.11.2, “Page Boundaries”). If the specified page boundary is not defined in the page object, its default value shall be used, as specified in Table 30. Default value: CropBox. This entry is intended primarily for use by prepress applications that interpret or manipulate the page boundaries as described in 14.11.2, “Page Boundaries.” NOTE 4 Most conforming readers disregard it. |
PrintScaling | name | (Optional; PDF 1.6) The page scaling option that shall be selected when a print dialog is displayed for this document. Valid values are None, which indicates no page scaling, and AppDefault, which indicates the conforming reader’s default print scaling. If this entry has an unrecognized value, AppDefault shall be used. Default value: AppDefault. If the print dialog is suppressed and its parameters are provided from some other source, this entry nevertheless shall be honored. |
Duplex | name | (Optional; PDF 1.7) The paper handling option that shall be used when printing the file from the print dialog. The following values are valid:
|
PickTrayByPDFSize | boolean | (Optional; PDF 1.7) 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 a conforming reader. If PickTrayByPDFSize is true, the check box in the print dialog associated with input paper tray shall be checked. This setting has no effect on operating systems that do not provide the ability to pick the input tray by size. Default value: as defined by the conforming reader |
PrintPageRange | array | (Optional; PDF 1.7) 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. Default value: as defined by the conforming reader |
NumCopies | integer | (Optional; PDF 1.7) The number of copies that shall be printed when the print dialog is opened for this file. Values outside this range shall be ignored. Default value: as defined by the conforming reader, but typically 1 |