ByteScout PDF Suite - VBScript - Add link to page in pdf with pdf sdk - ByteScout

ByteScout PDF Suite – VBScript – Add link to page in pdf with pdf sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Suite – VBScript – Add link to page in pdf with pdf sdk

How to add link to page in pdf with pdf sdk in VBScript using ByteScout PDF Suite

Step-by-step tutorial on how to add link to page in pdf with pdf sdk in VBScript

These source code samples are assembled by their programming language and functions they apply. What is ByteScout PDF Suite? It is the bundle that provides six different SDK libraries 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. It can help you to add link to page in pdf with pdf sdk in your VBScript application.

The SDK samples given below describe how to quickly make your application do add link to page in pdf with pdf sdk in VBScript with the help of ByteScout PDF Suite. 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. Complete and detailed tutorials and documentation are available along with installed ByteScout PDF Suite if you’d like to learn more about the topic and the details of the API.

You can download free trial version of ByteScout PDF Suite from our website with this and other 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)

LinkToPage.vbs
      
' 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

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