Description
Links the current object to an object that already exists in the PDF document.
Applies to
Syntax
long LinkToObject(PDFModel object)
Argument |
Description |
---|---|
object |
The object that the current object links to. The object type can only be one of the following: PDFText, PDFImage, PDFMultilinkText, PDFTextBlock. |
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 specified object.
Examples
The following example links the PDFText object (with the content "jump to me") to the current PDFText object (with the content "I am PDFtexttext).
PDFdocument lpdf_doc PDFpage lpdf_page PDFtext lpdf_text,lpdf_textlink lpdf_doc = create PDFdocument lpdf_page = create PDFpage lpdf_text = create PDFtext lpdf_textlink = create PDFtext lpdf_text.backcolor.rgb = rgb(255,0,0) lpdf_text.textcolor.rgb = rgb(0,255,0) lpdf_text.font.fontsize = 38 lpdf_text.content = "I am PDFtext text" lpdf_textlink.content = "jump to me" //Support PDFtext, PDFmultilinetext, PDFimage, and PDFtextblock lpdf_text.linktoobject( lpdf_textlink) lpdf_page.addcontent( lpdf_text) lpdf_page.addcontent( lpdf_textlink) lpdf_doc.addpage( lpdf_page) lpdf_doc.save( "D:\textlink.pdf")
See also
PDFText, PDFImage, PDFTextBlock objects:
PDFMultilineText objects: