←Select platform

PageFitType Property

Summary
Target page fit type of the initial page.
Syntax
C#
C++/CLI
Java
Python
public PDFPageFitType PageFitType { get; set; } 
public PDFPageFitType getPageFitType(); 
public void setPageFitType( 
   PDFPageFitType pDFPageFitType 
); 
public: 
property PDFPageFitType PageFitType { 
   PDFPageFitType get(); 
   void set (    PDFPageFitType ); 
} 
PageFitType # get and set (PDFInitialViewOptions) 

Property Value

A PDFPageFitType enumeration member that specifies the target page fit type of the initial page. The default value is PDFPageFitType.Default.

Remarks

The page fit type of the target page. External viewers should set the page view properties based on this value when the PDF file is loaded. A value of PDFPageFitType.Default means do not change the page fit mode when going to the initial page.

Example
C#
using Leadtools.WinForms; 
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
 
 
public void PDFFileInitialViewOptionsExample() 
{ 
   string sourceFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Leadtools.pdf"); 
   string destinationFileName = Path.Combine(LEAD_VARS.ImagesDir, @"LEAD_InitialView.pdf"); 
 
   PDFFile pdfFile = new PDFFile(sourceFileName); 
 
   PDFInitialViewOptions myInitialViewOptions = new PDFInitialViewOptions(); 
   myInitialViewOptions.AutoPrint = false; 
   myInitialViewOptions.CenterWindow = false; 
   myInitialViewOptions.DisplayDocTitle = true; 
   myInitialViewOptions.FitWindow = false; 
   myInitialViewOptions.HideMenubar = true; 
   myInitialViewOptions.HideToolbar = true; 
   myInitialViewOptions.HideWindowUI = true; 
   myInitialViewOptions.PageFitType = PDFPageFitType.FitWidth; 
   myInitialViewOptions.PageLayoutType = PDFPageLayoutType.OneColumnDisplay; 
   myInitialViewOptions.PageModeType = PDFPageModeType.PageOnly; 
   myInitialViewOptions.PageNumber = 2; 
   myInitialViewOptions.ZoomPercent = 100; 
 
   pdfFile.InitialViewOptions = myInitialViewOptions; 
 
   pdfFile.SetInitialView(destinationFileName); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.7.10
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.