Components for Developers
© 2000-2008, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
Viewer preferences
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

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF Add-on History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2008, Two Pilots