The following VBScript example demonstrates how Server can be used to add different types of bookmarks to a PDF file during conversion. This example uses the following Server Methods:
AddFileBookmark - Adds a bookmark that links to an external document.
AddLinkedPDFBookmark - Adds a bookmark that links to an external PDF.
AddPageBookmark - Adds a bookmark that links to a specified page within the PDF.
AddURLBookmark - Adds a bookmark that links to an external URL.
PSToPDF - Converts a PostScript® file to PDF.
These files are required:
example.pdf - The destination external PDF.
example.txt - The destination external file.
postscript.ps - The PostScript file to convert to PDF.
Bookmarks.vbs - Code detail provided below.
NOTE: This example is available for other programming environments. Please select from the Code Samples list above to display the download link for this example in the language appropriate to your environment.
Click here to download this example for VBScript (includes required files):
' Variables
' Current Path arrayScr = Split(WScript.ScriptFullName, "\", -1, 1) For i = 0 to UBound(arrayScr) - 1
strPath = strPath & arrayScr(i) & "\"
Next strOutputDir = strPath
' Name of PS file to convert strPSFileName = "postscript.ps"
' Name of PDF file to create strPDFFileName = "ps.pdf"
' Instantiate activePDF Server Object
Set objSVR = CreateObject("APServer.Object")
' *Must call Bookmark methods prior to ImageToPDF, PSToPDF, or StartPrinting
11040 - AddInternalLinkBookmarkAddInternalLinkBookmark instructs Toolkit to create a bookmark in the current output file that
connects to a specified internal designation in PDF.AddInter...
11041 - AddLaunchBookmarkAddLaunchBookmark instructs Toolkit to create a bookmark in the current output file that executes a
command in the OS shell.AddLaunchBookmark
11046 - AddTextBookmarkAddTextBookmark instructs Toolkit to create a text-only bookmark in the current output file. This is
useful for grouping multiple bookmarks on a similar topic or categorizing bookmarks into...
11048 - AddURLBookmarkAddURLBookmark instructs Toolkit to create a bookmark in the current output file that connects to an
external URL.
AddURLBookmark BookmarkT...
The information in this article is for the use of activePDF Customers and Evaluation Users Only. No part of this document may be transmitted or reproduced without the express written consent of activePDF.