easyPDF SDK Usermanual
PDF Creator Programming API  |  Download Free Trial  |  Contact Us to Purchase

ExtractAllHyperlinks Method

Extracts all hyperlinks from a PDF file and return an XML string to the caller.
The data contained in the XML string can be used to invoke AddHyperlink function in BCL easyPDF SDK for creating hyperlinks in PDF file.

string ExtractAllHyperlinks()

Function ExtractAllHyperlinks() As String

def ExtractAllHyperlinks(self)

String ExtractAllHyperlinks() throws PDFProcessorException

function ExtractAllHyperlinks() 

BclPrcResult ExtractAllHyperlinks(BclPDFProcessorHandle* pHandle,
                                  wchar_t** poutVal);
Function ExtractAllHyperlinks() As String



Return Values

String in an XML format.
Sample XML string will look like the following:

<?xml version="1.0" encoding="utf-8" ?>
<Hyperlink id="1" page="0" left="50" top="80" right="370" bottom="100" url="http://www.bcltechnologies.com/"/>
<Hyperlink id="2" page="1" left="60" top="90" right="380" bottom="120" url="http://www.pdfonline.com/"/>
<Hyperlink id="3" page="3" left="70" top="100" right="390" bottom="120" url="http://www.bcltechnologies.com/"/>


Note: New attributes can be added to Hyperlink element if needed.
Assumption: The user needs to know how to parse data from an XML string.

For those who are familiar with ExtractAllHyperlinks from the PDFProcessor object, note that this version of ExtractAllHyperlinks from the PDFProcessorHandle object does not take an optional password argument for working with encrypted PDF files. If and when PDFProcessorHandle is enhanced to support processing of encrypted PDF files, the password required will be taken by OpenFile or OpenMem at the time the PDFProcessorHandle is obtained.

Example Usage in VBScript

Set oProcessor = CreateObject("easyPDF.PDFProcessor.8")
Set oProcessorHandle = oProcessor.OpenFile("C:\test\input.pdf", "C:\test\input.pdf")

hyperlinks = oProcessorHandle.ExtractAllHyperlinks

MsgBox hyperlinks

Example Usage in VB.NET

Dim oProcessor As PDFProcessor = New PDFProcessor
Dim oProcessorHandle As PDFProcessorHandle = oProcessor.OpenFile("C:\test\input.pdf", "C:\test\input.pdf")

Dim hyperlinks As String = oProcessorHandle.ExtractAllHyperlinks()


Example Usage in C#

PDFProcessor oProcessor = new PDFProcessor();
PDFProcessorHandle oProcessorHandle = oProcessor.OpenFile(@"C:\test\input.pdf", @"C:\test\input.pdf", null);

string hyperlinks = oProcessorHandle.ExtractAllHyperlinks();