Sample source code below will show you how to cope with a difficult task like set PDF document display options in VB.NET. ByteScout PDF SDK is the pdf library that can create, update and modify PDF files. Supports text with fonts and style selections, layers, form fields, drawing lines and objects, automatic tables, images. Can be used to create and fill pdf forms and you can use it to set PDF document display options with VB.NET.
You will save a lot of time on writing and testing code as you may just take the VB.NET code from ByteScout PDF SDK for set PDF document display options below and use it in your application. In your VB.NET project or application you may simply copy & paste the code and then run your app! Use of ByteScout PDF SDK in VB.NET is also explained in the documentation included along with the product.
You can download free trial version of ByteScout PDF SDK from our website to see and try many others source code samples for VB.NET.
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to set display options for a viewer application. ''' </summary> Class Program Shared Sub Main() ' Create new document Dim pdfDocument = New Document() pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" ' Add page Dim page = New Page(PaperFormat.A4) pdfDocument.Pages.Add(page) ' Set page mode (which panels should be shown at viewing application start) pdfDocument.PageMode = PageMode.Thumbnail ' show thumbnails panel ' Show/hide various interface elements pdfDocument.ViewerPreferences.CenterWindow = True pdfDocument.ViewerPreferences.FitWindow = True pdfDocument.ViewerPreferences.HideMenubar = True pdfDocument.ViewerPreferences.HideToolbar = True pdfDocument.ViewerPreferences.HideWindowUI = False ' Save document to file pdfDocument.Save("result.pdf") ' Cleanup pdfDocument.Dispose() ' Open document in default PDF viewer app Process.Start("result.pdf") End Sub End Class