CenterWindow
IPDFDocument4 :: General document management :: Viewer preferences

See Also Example
Collapse All

This property gets or sets the value indicating whether the PDF reader should center the document on the screen.

Syntax

VARIANT_BOOL CenterWindow { get; set; }
Value
VARIANT_TRUE if the PDF reader centers the document on the screen, VARIANT_FALSE otherwise

Example

Setting PDF Viewer Preferences

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.PageWidth := 300;
PDF.PageHeight := 450;
PDF.SetTextPosition(125, 200);
PDF.ShowText('Hello, World!');

PDF.FitWindow := false;
PDF.CenterWindow := true;
PDF.HideViewerMenuBar := true;
PDF.HideViewerToolBar := true;
PDF.HideViewerUI := true;
PDF.InitialZoomPercent := 100;
{ or use }
{ PDF.InitialZoom = ZoomName.znFitPage; }
PDF.ViewerMode := mtUseThumbnails;
PDF.ViewerPageLayout := ltSinglePage;

PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->PageWidth = 300;
PDF->PageHeight = 450;
PDF->SetTextPosition(125, 200);
PDF->ShowText("Hello, World!");

PDF->FitWindow = false;
PDF->CenterWindow = true;
PDF->HideViewerMenuBar = true;
PDF->HideViewerToolBar = true;
PDF->HideViewerUI = true;
PDF->InitialZoomPercent = 100;
// or use
// PDF->InitialZoom = znFitPage;
PDF->ViewerMode = mtUseThumbnails;
PDF->ViewerPageLayout = ltSinglePage;

PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.PageWidth = 300;
PDF.PageHeight = 450;
PDF.SetTextPosition(125, 200);
PDF.ShowText("Hello, World!");

PDF.FitWindow = false;
PDF.CenterWindow = true;
PDF.HideViewerMenuBar = true;
PDF.HideViewerToolBar = true;
PDF.HideViewerUI = true;
PDF.InitialZoomPercent = 100;
// or use
// PDF.InitialZoom = ZoomName.znFitPage;
PDF.ViewerMode = ModeType.mtUseThumbnails;
PDF.ViewerPageLayout = LayoutType.ltSinglePage;

PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.PageWidth = 300
PDF.PageHeight = 450
PDF.SetTextPosition 125, 200
PDF.ShowText "Hello, World!"

PDF.FitWindow = false
PDF.CenterWindow = true
PDF.HideViewerMenuBar = true
PDF.HideViewerToolBar = true
PDF.HideViewerUI = true
PDF.InitialZoomPercent = 100
' or use
' PDF.InitialZoom = 0 'ZoomName.znFitPage
PDF.ViewerMode = 2' ModeType.mtUseThumbnails
PDF.ViewerPageLayout = 0' LayoutType.ltSinglePage

PDF.SaveToFile "test.pdf", true

See Also

Reference