ByteScout PDF SDK - VBScript and VB6 - Create Bookmarks for Navigation in PDF - ByteScout

ByteScout PDF SDK – VBScript and VB6 – Create Bookmarks for Navigation in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VBScript and VB6 – Create Bookmarks for Navigation in PDF

How to create bookmarks for navigation in PDF in VBScript and VB6 and ByteScout PDF SDK

Tutorial on how to create bookmarks for navigation in PDF in VBScript and VB6

ByteScout tutorials are designed to explain the code for both VBScript and VB6 beginners and advanced programmers. ByteScout PDF SDK is the SDK for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings. It can be used to create bookmarks for navigation in PDF using VBScript and VB6.

The SDK samples like this one below explain how to quickly make your application do create bookmarks for navigation in PDF in VBScript and VB6 with the help of ByteScout PDF SDK. In order to implement the functionality, you should copy and paste this code for VBScript and VB6 below into your code editor with your app, compile and run your application. Detailed tutorials and documentation are available along with installed ByteScout PDF SDK if you’d like to dive deeper into the topic and the details of the API.

Download free trial version of ByteScout PDF SDK from our website with this and other source code samples for VBScript and VB6.

Try ByteScout PDF SDK today: Get 60 Day Free Trial or sign up for Web API

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

Try ByteScout PDF SDK today: 60 Day Free Trial (on-premise version) or sign up for Web API (on demand version)

VIDEO

ON-PREMISE VERSION

Get 60 Day Free Trial or Visit ByteScout PDF SDK page

Explore ByteScout PDF SDK documentation

WEB API

Sign Up for free Web API key

Explore Web API Documentation

Tutorials:

prev
next