←Select platform

PDFInitialViewOptions Class

Summary

The PDFInitialViewOptions class provides options for controlling the initial view and actions that should be applied by external viewers when the PDF file is opened.

Syntax

C#
VB
C++
[SerializableAttribute()] 
public class PDFInitialViewOptions 
<SerializableAttribute()> 
Public Class PDFInitialViewOptions  
[SerializableAttribute()] 
public ref class PDFInitialViewOptions  

Remarks

Use the PDFInitialViewOptions class to specify options that control the initial view and actions that should be applied by external viewers when the PDF file is opened.

Example

C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Drawing; 
using Leadtools.ImageProcessing; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
using Leadtools.WinForms; 
 
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:\Users\Public\Documents\LEADTOOLS Images"; 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.Pdf 
Imports Leadtools.WinForms 
Imports Leadtools.Svg 
Imports Leadtools.ImageProcessing 
 
Public Sub PDFFileInitialViewOptionsExample() 
   Dim sourceFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "Leadtools.pdf") 
   Dim destinationFileName As String = Path.Combine(LEAD_VARS.ImagesDir, "LEAD_InitialView.pdf") 
 
   Dim pdfFile As PDFFile = New PDFFile(sourceFileName) 
 
   Dim myInitialViewOptions As PDFInitialViewOptions = 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) 
End Sub 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" 
End Class 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly