Description
Links the current object to a URL.
Applies to
Syntax
long SetLinkAddress(string linkAddress)
Argument |
Description |
---|---|
linkAddress |
The URL that the current object links to. It may be a URL to a local file, FTP address, HTTP/HTTPS address, or an email address. The supported URL protocols include:
|
Return value
Long. Returns 1 if it succeeds, or -1 if an error occurs. For more errors, see the Error Codes.
Usage
Call the function to link the current object with the URL to a local file, FTP address, HTTP/HTTPS address, or an email address. When the object is clicked in the PDF document, the URL will be opened.
Examples
The following example links the PDFImage object in the document to the URL address https://translate.google.com.
PDFdocument lpdf_doc PDFpage lpdf_page pdfimage lpdf_image lpdf_doc = create PDFdocument lpdf_page = create PDFpage lpdf_image = create pdfimage lpdf_image.filename = "D:\image1\1.jpg" lpdf_image.setsize( 100, 100) // setlinkaddress lpdf_image.setlinkaddress( "https://translate.google.com") //getlinkaddress lpdf_image.getlinkaddress( ) lpdf_page.addcontent( lpdf_image) lpdf_doc.addpage( lpdf_page) lpdf_doc.save( "D:\save\pdfimage_setlink.pdf")
PDFText, PDFImage, PDFTextBlock objects:
PDFMultilineText objects: