PdfTextWebLink
12 Sep 20253 minutes to read
PdfTextWebLink class represents the class for text web link annotation.
// create a new PDF document.
let document : PdfDocument = new PdfDocument();
// add a page to the document.
let page1 : PdfPage = document.pages.add();
// create the font
let font : PdfFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
//
// create the Text Web Link
let textLink : PdfTextWebLink = new PdfTextWebLink();
// set the hyperlink
textLink.url = 'http://www.google.com';
// set the link text
textLink.text = 'Google';
// set the font
textLink.font = font;
// draw the hyperlink in PDF page
textLink.draw(page1, new PointF(10, 40));
//
// save the document.
document.save('output.pdf');
// destroy the document
document.destroy();Properties
font PdfFont
Gets or sets a PdfFont that defines the text format.
// create a new PDF document.
let document : PdfDocument = new PdfDocument();
// add a page to the document.
let page1 : PdfPage = document.pages.add();
// create the font
let font : PdfFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
// create the Text Web Link
let textLink : PdfTextWebLink = new PdfTextWebLink();
// set the hyperlink
textLink.url = 'http://www.google.com';
// set the link text
textLink.text = 'Google';
//
// set the font
textLink.font = font;
//
// draw the hyperlink in PDF page
textLink.draw(page1, new PointF(10, 40));
// save the document.
document.save('output.pdf');
// destroy the document
document.destroy();text string
Gets or sets a value indicating the text that should be printed.
// create a new PDF document.
let document : PdfDocument = new PdfDocument();
// add a page to the document.
let page1 : PdfPage = document.pages.add();
// create the font
let font : PdfFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
// create the Text Web Link
let textLink : PdfTextWebLink = new PdfTextWebLink();
// set the hyperlink
textLink.url = 'http://www.google.com';
//
// set the link text
textLink.text = 'Google';
//
// set the font
textLink.font = font;
// draw the hyperlink in PDF page
textLink.draw(page1, new PointF(10, 40));
// save the document.
document.save('output.pdf');
// destroy the document
document.destroy();url string
Gets or sets the Uri address.
// create a new PDF document.
let document : PdfDocument = new PdfDocument();
// add a page to the document.
let page1 : PdfPage = document.pages.add();
// create the font
let font : PdfFont = new PdfStandardFont(PdfFontFamily.Helvetica, 12);
// create the Text Web Link
let textLink : PdfTextWebLink = new PdfTextWebLink();
//
// set the hyperlink
textLink.url = 'http://www.google.com';
//
// set the link text
textLink.text = 'Google';
// set the font
textLink.font = font;
// draw the hyperlink in PDF page
textLink.draw(page1, new PointF(10, 40));
// save the document.
document.save('output.pdf');
// destroy the document
document.destroy();