ByteScout Premium Suite - VBScript - Create bookmarks for navigation in pdf with pdf sdk - ByteScout

ByteScout Premium Suite – VBScript – Create bookmarks for navigation in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Premium Suite – VBScript – Create bookmarks for navigation in pdf with pdf sdk

How to create bookmarks for navigation in pdf with pdf sdk in VBScript with ByteScout Premium Suite

How to write a robust code in VBScript to create bookmarks for navigation in pdf with pdf sdk with this step-by-step tutorial

An easy to understand sample source code to learn how to create bookmarks for navigation in pdf with pdf sdk in VBScript ByteScout Premium Suite: the set that includes 12 SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording. It can create bookmarks for navigation in pdf with pdf sdk in VBScript.

Want to save time? You will save a lot of time on writing and testing code as you may just take the VBScript code from ByteScout Premium Suite for create bookmarks for navigation in pdf with pdf sdk below and use it in your application. IF you want to implement the functionality, just copy and paste this code for VBScript below into your code editor with your app, compile and run your application. Use of ByteScout Premium Suite in VBScript is also described in the documentation included along with the product.

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)

Bookmarks.vbs
      
' This example demonstrates how to create document outlines (bookmarks). ' Create Bytescout.PDF.Document object Set pdfDocument = CreateObject("Bytescout.PDF.Document") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Set comHelpers = pdfDocument.ComHelpers Set font = comHelpers.CreateStandardFont(comHelpers.STANDARDFONTS_TIMES, 18) Set brush = comHelpers.CreateSolidBrush(comHelpers.CreateColorGray(0)) ' Create pages For i = 0 To 2 Set newPage = comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4) newPage.Canvas.DrawString "Page " & (i + 1), (font), (brush), 20, 20 pdfDocument.Pages.Add(newPage) Next ' Create outlines: Set destination1 = comHelpers.CreateDestination(pdfDocument.Pages.Item(0), 0) Set outline1 = comHelpers.CreateOutline_2("Page 1", (destination1)) pdfDocument.Outlines.Add(outline1) ' Example of sub-bookmark Set destination2 = comHelpers.CreateDestination(pdfDocument.Pages.Item(1), 0) Set outline2 = comHelpers.CreateOutline_2("Page 2", (destination2)) pdfDocument.Outlines.Item(0).Kids.Add(outline2) Set destination3 = comHelpers.CreateDestination(pdfDocument.Pages.Item(2), 0) Set outline3 = comHelpers.CreateOutline_2("Page 3", (destination3)) pdfDocument.Outlines.Add(outline3) ' Force PDF viewer to show Bookmarks panel at start up. pdfDocument.PageMode = comHelpers.PAGEMODE_OUTLINES ' 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