ByteScout Premium Suite - VBScript - Add page numbers in pdf with pdf sdk - ByteScout

ByteScout Premium Suite – VBScript – Add page numbers in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – VBScript – Add page numbers in pdf with pdf sdk

How to add page numbers in pdf with pdf sdk in VBScript with ByteScout Premium Suite

Learn to add page numbers in pdf with pdf sdk in VBScript

Sample source code below will display you how to manage a complex task like add page numbers in pdf with pdf sdk in VBScript. What is ByteScout Premium Suite? It is the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can help you to add page numbers in pdf with pdf sdk in your VBScript application.

This prolific sample source code in VBScript for ByteScout Premium Suite contains various functions and other necessary options you should do calling the API to add page numbers in pdf with pdf sdk. Just copy and paste the code into your VBScript application’s code and follow the instructions. Further improvement of the code will make it more robust.

Our website gives trial version of ByteScout Premium 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)

PageNumbers.vbs
      
' This example demonstrates how to add page numbers (labels) visible in the page thumbnails panel of PDF viewer. ' Create Bytescout.PDF.Document object Set pdfDocument = CreateObject("Bytescout.PDF.Document") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Set comHelpers = pdfDocument.ComHelpers ' Add twenty pages For i = 0 To 19 pdfDocument.Pages.Add(comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4)) Next ' First five pages will have roman numbers I, II, III, ... Set pageLabel = comHelpers.CreatePageLabel(0, comHelpers.PAGENUMBERINGSTYLE_UPPERCASEROMAN) pdfDocument.PageLabels.Add(pageLabel) ' Next five pages will have arabic numbers 6, 7, 8, ... pageLabel.Style = comHelpers.PAGENUMBERINGSTYLE_DECIMALARABIC pageLabel.StartPortion = 6 pageLabel.FirstPageIndex = 5 pdfDocument.PageLabels.Add(pageLabel) ' Next five pages will have complex page numbers with prefix A-11, A-12, A-13, ... pageLabel.Style = comHelpers.PAGENUMBERINGSTYLE_DECIMALARABIC pageLabel.Prefix = "A-" pageLabel.StartPortion = 11 pageLabel.FirstPageIndex = 10 pdfDocument.PageLabels.Add(pageLabel) ' Next five pages will use letters as page numbers P, Q, R, ... pageLabel.Prefix = "" pageLabel.Style = comHelpers.PAGENUMBERINGSTYLE_UPPERCASELETTERS pageLabel.StartPortion = 16 pageLabel.FirstPageIndex = 15 pdfDocument.PageLabels.Add(pageLabel) ' Force PDF viewer to show page thumbnails panel on start up pdfDocument.PageMode = comHelpers.PAGEMODE_THUMBNAIL ' Save 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 Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium 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 Premium Suite Home Page

Explore ByteScout Premium Suite Documentation

Explore Samples

Sign Up for ByteScout Premium Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next