HelpBot Assistant

How can I help you?

PdfViewerPreferences

6 Feb 20269 minutes to read

Defines the way the document is to be presented on the screen or in print.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets viewer preferences
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Destroy the document
document.destroy();

Properties

Get centerWindow boolean

A flag specifying whether to position the document’s window in the center of the screen.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the center window
let centerWindow : boolean = viewerPreferences.centerWindow;
// Destroy the document
document.destroy();

Set centerWindow void

A flag specifying whether to position the document’s window in the center of the screen.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the center window
viewerPreferences.centerWindow = true;
// Destroy the document
document.destroy();

Parameters: value: boolean

Get displayTitle boolean

A flag specifying whether the window’s title bar should display the document title taken
from the Title entry of the document information dictionary. If false, the title bar
should instead display the name of the PDF file containing the document.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the display title
let displayTitle : boolean = viewerPreferences.displayTitle;
// Destroy the document
document.destroy();

Set displayTitle void

A flag specifying whether the window’s title bar should display the document title taken
from the Title entry of the document information dictionary. If false, the title bar
should instead display the name of the PDF file containing the document.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the display title
viewerPreferences.displayTitle = true;
// Destroy the document
document.destroy();

Parameters: value: boolean

Get duplex DuplexMode

Gets print duplex mode handling option to use when printing the file from the print dialog.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the duplex
let duplex : DuplexMode = viewerPreferences.duplex;
// Destroy the document
document.destroy();

Set duplex void

Sets print duplex mode handling option to use when printing the file from the print dialog.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the duplex
viewerPreferences.duplex = DuplexMode.DuplexFlipLongEdge;
// Destroy the document
document.destroy();

Parameters: value: DuplexMode

Get fitWindow boolean

A flag specifying whether to resize the document’s window to fit the size of the first
displayed page.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the fit window
let fitWindow : boolean = viewerPreferences.fitWindow;
// Destroy the document
document.destroy();

Set fitWindow void

A flag specifying whether to resize the document’s window to fit the size of the first
displayed page.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the fit window
viewerPreferences.fitWindow = true;
// Destroy the document
document.destroy();

Parameters: value: boolean

Get hideMenuBar boolean

A flag specifying whether to hide the viewer application’s menu bar when the
document is active.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the hide menu bar
let hideMenuBar: boolean = viewerPreferences.hideMenuBar;
// Destroy the document
document.destroy();

Set hideMenuBar void

A flag specifying whether to hide the viewer application’s menu bar when the
document is active.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the hide menu bar
viewerPreferences.hideMenuBar = true;
// Destroy the document
document.destroy();

Parameters: value: boolean

Get hideToolBar boolean

A flag specifying whether to hide the viewer application’s tool bar when the
document is active.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the hide tool bar
let hideToolBar: boolean = viewerPreferences.hideToolBar;
// Destroy the document
document.destroy();

Set hideToolBar void

A flag specifying whether to hide the viewer application’s tool bar when the
document is active.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the hide tool bar
viewerPreferences.hideToolbar = true;
// Destroy the document
document.destroy();

Parameters: value: boolean

Get hideWindowUI boolean

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.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the hide window UI
let hideWindowUI: boolean = viewerPreferences.hideWindowUI;
// Destroy the document
document.destroy();

Set hideWindowUI void

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.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the hide window UI
viewerPreferences.hideWindowUI = true;
// Destroy the document
document.destroy();

Parameters: value: boolean

Get pageLayout PdfPageLayout

A name object specifying the page layout to be used when the document is opened.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the page layout
let pageLayout : PdfPageLayout = viewerPreferences.pageLayout;
// Destroy the document
document.destroy();

Set pageLayout void

A name object specifying the page layout to be used when the document is opened.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the page layout
viewerPreferences.pageLayout = PdfPageLayout.TwoColumnLeft;
// Destroy the document
document.destroy();

Parameters: value: PdfPageLayout

Get pageMode PdfPageMode

A name object specifying how the document should be displayed when opened.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the page mode
let pageMode: PdfPageMode = viewerPreferences.pageMode;
// Destroy the document
document.destroy();

Set pageMode void

A name object specifying how the document should be displayed when opened.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the page mode
viewerPreferences.pageMode = PdfPageMode.UseOutlines;
// Destroy the document
document.destroy();

Parameters: value: PdfPageMode

Get pageScaling PageScalingMode

Gets the page scaling option to be selected
when a print dialog is displayed for this document.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Gets the page scaling
let pageScaling : PageScalingMode = viewerPreferences.pageScaling;
// Destroy the document
document.destroy();

Set pageScaling void

Sets the page scaling option to be selected
when a print dialog is displayed for this document.

// Create a new PDF document
let document : PdfDocument = new PdfDocument();
// Gets the viewer preferences of the document
let viewerPreferences : PdfViewerPreferences = document.viewerPreferences;
// Sets the page scaling
viewerPreferences.pageScaling = PageScalingMode.None;
// Destroy the document
document.destroy();

Parameters: value: PageScalingMode