An easy to understand sample source code to learn how to add link to page in pdf with pdf sdk in VBScript Want to add link to page in pdf with pdf sdk in your VBScript app? ByteScout Premium Suite is designed for it. ByteScout Premium Suite is the bundle that includes twelve SDK products from ByteScout including tools and components for PDF, barcodes, spreadsheets, screen video recording.
These VBScript code samples for VBScript guide developers to speed up coding of the application when using ByteScout Premium Suite. Simply copy and paste in your VBScript project or application you and then run your app! Use of ByteScout Premium Suite in VBScript is also described in the documentation included along with the product.
ByteScout Premium Suite free trial version is available on our website. VBScript and other programming languages are supported.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
' This example demonstrates how to create a navigation link to a page. ' Create Bytescout.PDF.Document object Set pdfDocument = CreateObject("Bytescout.PDF.Document") pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" Set comHelpers = pdfDocument.ComHelpers ' Add two pages Set page1 = comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4) pdfDocument.Pages.Add(page1) Set page2 = comHelpers.CreatePage(comHelpers.PAPERFORMAT_A4) pdfDocument.Pages.Add(page2) Set font = comHelpers.CreateStandardFont(comHelpers.STANDARDFONTS_TIMES, 12) Set brush = comHelpers.CreateSolidBrush(comHelpers.CreateColorGray(0)) ' Create link annotation pointing to Page 2, 200 Points from the top. Set destination = comHelpers.CreateDestination((page2), 200) Set link = comHelpers.CreateLinkAnnotation((destination), 20, 20, 100, 25) link.Color = comHelpers.CreateColorRGB(255, 0, 0) ' you can change the link color page1.Annotations.Add(link) ' Draw link text (optional) Set stringFormat = comHelpers.CreateStringFormat() stringFormat.HorizontalAlign = comHelpers.HORIZONTALALIGN_CENTER stringFormat.VerticalAlign = comHelpers.VERTICALALIGN_CENTER page1.Canvas.DrawString_7 "Link to Page 2", (font), (brush), 20, 20, 100, 25, (stringFormat) ' Draw a text at the link target page2.Canvas.DrawString "Link target", (font), (brush), 20, 200 ' 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
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
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
Get Your API Key
Explore Web API Docs
Explore Web API Samples
also available as: