ByteScout PDF Suite - VB.NET - Set passwords and permissions for pdf with pdf sdk - ByteScout

ByteScout PDF Suite – VB.NET – Set passwords and permissions for pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VB.NET – Set passwords and permissions for pdf with pdf sdk

How to set passwords and permissions for pdf with pdf sdk in VB.NET using ByteScout PDF Suite

Learning is essential in computer world and the tutorial below will demonstrate how to set passwords and permissions for pdf with pdf sdk in VB.NET

On this page you will learn from code samples for programming in VB.NET.Writing of the code to set passwords and permissions for pdf with pdf sdk in VB.NET can be executed by programmers of any level using ByteScout PDF Suite. ByteScout PDF Suite is the set that includes 6 SDK products to work with PDF from generating rich PDF reports to extracting data from PDF documents and converting them to HTML. This bundle includes PDF (Generator) SDK, PDF Renderer SDK, PDF Extractor SDK, PDF to HTML SDK, PDF Viewer SDK and PDF Generator SDK for Javascript. It can be applied to set passwords and permissions for pdf with pdf sdk using VB.NET.

Want to save time? You will save a lot of time on writing and testing code as you may just take the VB.NET code from ByteScout PDF Suite for set passwords and permissions for pdf with pdf sdk below and use it in your application. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Want to see how it works with your data then code testing will allow the function to be tested and work properly.

Our website gives trial version of ByteScout PDF Suite for free. It also includes documentation and source code samples.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.vb
      
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to lock the document with a password. ''' PDF format supports two kinds of passwords: owner and user password. ''' User password allows to view document and perform allowed actions. ''' Owner password allows everything, including changing passwords and permissions. ''' </summary> Class Program Shared Sub Main() ' Create new document Dim pdfDocument = New Document() pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" ' Add page pdfDocument.Pages.Add(New Page(PaperFormat.A4)) ' Set document encryption algorythm pdfDocument.Security.EncryptionAlgorithm = EncryptionAlgorithm.RC4_40bit ' Set various user permissions pdfDocument.Security.AllowPrintDocument = False pdfDocument.Security.AllowContentExtraction = False pdfDocument.Security.AllowModifyAnnotations = False pdfDocument.Security.PrintQuality = PrintQuality.LowResolution ' Set owner password pdfDocument.Security.OwnerPassword = "ownerpassword" ' Set user password pdfDocument.Security.UserPassword = "userpassword" ' 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

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF Suite Home Page

Explore ByteScout PDF Suite Documentation

Explore Samples

Sign Up for ByteScout PDF Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next