public PDFPoint Position { get; set; }
Position # get and set (PDFInitialViewOptions)
A PDFPoint that represents the position in PDF units (1/72 of an inch and bottom-left) of the initial page to scroll to. The default value is an empty PDFPoint.
Set this property to indicate the position to scroll to when the PDF file is opened.
The position is in PDF units (1/72 of an inch and bottom-left). So to go to the top of the page, you must go to "0, PageHeight". You can use the PDFDocumentPage.ConvertPoint helper method to convert from pixel or inches to PDF units and back.
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";
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document