Online Documentation for Advanced PDF Generator for RAD Studio

LinkName and LinkTarget Example


This example displays the usage of the LinkName and the LinkTarget properties of the TRenderAtom class and its descendants. The following code creates a link from the 'Click Here' text to the 'Link Position' text in the document footer, and a link from the document footer to the EMS Software Development site.

 

procedure TForm1.Button1Click(Sender: TObject);

var

  LinkPosition: TRenderWord;

begin

  LinkPosition := TRenderWord.Create('Link Position',TFont.Create());

  LinkPosition.LinkName := 'position';

  QuickPDF1.Document.Footer.AddItem(0, 0, LinkPosition);

  QuickPDF1.Document.Section[0].AddText('Click Here', TFont.Create(),rtaLeft, 'position');

  QuickPDF1.Document.Footer.LinkTarget := 'http://www.sqlmanager.net/';

  QuickPDF1.GenerateToFile;

end;