ByteScout PDF Suite - VBScript - Set passwords and permissions of pdf file with pdf sdk - ByteScout

ByteScout PDF Suite – VBScript – Set passwords and permissions of pdf file with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VBScript – Set passwords and permissions of pdf file with pdf sdk

How to set passwords and permissions of pdf file with pdf sdk in VBScript with ByteScout PDF Suite

Step-by-step tutorial on how to set passwords and permissions of pdf file with pdf sdk in VBScript

These sample source codes on this page below are displaying how to set passwords and permissions of pdf file with pdf sdk in VBScript. 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 and you can use it to set passwords and permissions of pdf file with pdf sdk with VBScript.

This prolific sample source code in VBScript for ByteScout PDF Suite contains various functions and other necessary options you should do calling the API to set passwords and permissions of pdf file with pdf sdk. Just copy and paste the code into your VBScript application’s code and follow the instructions. If you want to use these VBScript sample examples in one or many applications then they can be used easily.

You can download free trial version of ByteScout PDF Suite from our website to see and try many others source code samples for VBScript.

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

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

PasswordsAndPermissions.vbs
      
' 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. ' Create Bytescout.PDF.Document object Set pdfDocument = CreateObject("Bytescout.PDF.Document") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Set comHelpers = pdfDocument.ComHelpers ' Create document Set page1 = comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4) pdfDocument.Pages.Add(page1) ' or load existing one: 'pdfDocument.Load "c:\test\some-document.pdf" ' Set document encryption algorythm pdfDocument.Security.EncryptionAlgorithm = comHelpers.ENCRYPTIONALGORITHM_RC4_40BIT ' Set various user permissions pdfDocument.Security.AllowPrintDocument = False pdfDocument.Security.AllowContentExtraction = False pdfDocument.Security.AllowModifyAnnotations = False pdfDocument.Security.PrintQuality = comHelpers.PRINTQUALITY_LOWRESOLUTION ' Set owner password pdfDocument.Security.OwnerPassword = "ownerpassword" ' Set user password pdfDocument.Security.UserPassword = "userpassword" ' Save protected document to file pdfDocument.Save("result.pdf") ' Open document in default PDF viewer app Set shell = CreateObject("WScript.Shell") shell.Run "result.pdf", 1, false

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