How to set Viewer Preferences to a PDF document?
(Views :1693)

Essential PDF supports the setting of various ViewerPreferences properties by using the PdfDocument.ViewerPreferences class. The Viewer Preferences include hiding the Toolbar, MenuBar, and to set the Pagelayout , Pagemode, PageScaling mode etc.,

C#
//To hide Viewer application''s Toolbar when the document is active.
doc.ViewerPreferences.HideToolbar = true;
//To hide user Interface elements in the document window.
doc.ViewerPreferences.HideWindowUI = true;
//To hide Viewer Application''s MenuBar when the document is active.
doc.ViewerPreferences.HideMenubar = true;
//Setting Pagelayout of the Document.
doc.ViewerPreferences.PageLayout = PdfPageLayout.TwoPageLeft;
// Setting PrintScaling mode
doc.ViewerPreferences.PageScaling = PageScalingMode.AppDefault;
// Setting page mode
doc.ViewerPreferences.PageMode = PdfPageMode.FullScreen;
// To display the Windows Title from the Title entry of Document information Dictionary
doc.ViewerPreferences.DisplayTitle = true;
doc.DocumentInformation.Title = "ViewerPreferences";
// setting fit size
doc.ViewerPreferences.FitWindow = true;
VB
'To hide Viewer application''s Toolbar when the document is active.
doc.ViewerPreferences.HideToolbar = True
'To hide user Interface elements in the document window.
doc.ViewerPreferences.HideWindowUI = True
'To hide Viewer Application''s MenuBar when the document is active.
doc.ViewerPreferences.HideMenubar = True
'Setting Pagelayout of the Document.
doc.ViewerPreferences.PageLayout = PdfPageLayout.TwoPageLeft
' Setting PrintScaling mode
doc.ViewerPreferences.PageScaling = PageScalingMode.AppDefault
' Setting page mode
doc.ViewerPreferences.PageMode = PdfPageMode.FullScreen
' To display the Windows Title from the Title entry of Document information Dictionary
doc.ViewerPreferences.DisplayTitle = True
doc.DocumentInformation.Title = "ViewerPreferences"
' setting fit size
doc.ViewerPreferences.FitWindow = True

Please do find the sample from the below specified location,

http://www.syncfusion.com/support/user/uploads/PDF_ViewerPreferencesDemo_bf0b63d4.zip
::adCenter::