ByteScout PDF SDK - VBScript and VB6 - Add Link To Page in PDF - ByteScout

ByteScout PDF SDK – VBScript and VB6 – Add Link To Page in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VBScript and VB6 – Add Link To Page in PDF

How to add link to page in PDF in VBScript and VB6 and ByteScout PDF SDK

The tutorial shows how to add link to page in PDF in VBScript and VB6

This sample source code below will demonstrate you how to add link to page in PDF in VBScript and VB6. ByteScout PDF SDK can add link to page in PDF. It can be used from VBScript and VB6. ByteScout PDF SDK is the component to help programmers in generating new pdf files, modifying and updating existing pdf documents or pdf forms. Provides support for auto-filling pdf forms, adding text with adjustable font, style, size, font family, new form fields, vector and raster drawings.

This rich sample source code in VBScript and VB6 for ByteScout PDF SDK includes the number of functions and options you should do calling the API to add link to page in PDF. Follow the instructions from the scratch to work and copy the VBScript and VB6 code. Enjoy writing a code with ready-to-use sample codes in VBScript and VB6.

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

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 SDK Home Page

Explore ByteScout PDF SDK Documentation

Explore Samples

Sign Up for ByteScout PDF SDK 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 SDK Home Page

Explore ByteScout PDF SDK Documentation

Explore Samples

Sign Up for ByteScout PDF SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next