|
AddLinkAnnotation Method |
Top Previous Next |
|
The AddLinkAnnotation method is used to add a link annotation to the PDF document. To add a Link Annotation, create an instance of gtPDFLinkAnnot, set its properties and pass it to AddAnnotItem.
Syntax
Note: The annotation items added using this method need not be freed by the user. All the items will be freed at the end when EndDoc is called.
Example Code
[VC++] CgtPDFLinkAnnotationX LinkAnnot1; LinkAnnot1 = m_Engine.CreateLinkAnnotation(); LinkAnnot1.SetBorderColor(RGB(50, 147, 77)); LinkAnnot1.SetJSAction("app.alert('Hello, World! - with JavaScript')"); LinkAnnot1.SetRect(1, 2.5, 1.6, 2.65); m_Engine.AddLinkAnnotation(LinkAnnot1);
[C#] gtPDFLinkAnnotationX LinkAnnot1; LinkAnnot1 = AxgtPDFEngineX1.CreateLinkAnnotation(); LinkAnnot1.BorderColor = (uint) ColorTranslator.ToOle(Color.DarkOrange ); LinkAnnot1.SetJSAction("app.alert('Hello, World! - with JavaScript')"); LinkAnnot1.SetRect( 1, 2.5, 1.6, 2.65); AxgtPDFEngineX1.AddLinkAnnotation(LinkAnnot1);
[VB] Set LinkAnnot1 = gtEngineX1.CreateLinkAnnotation With LinkAnnot1 .BorderColor = RGB(50, 147, 77) .SetLaunchAction "sample.pdf", True .SetRect 1, 2.8, 1.6, 2.95 End With Call gtEngineX1.AddLinkAnnotation(LinkAnnot1)
|