Command IDs to create hyper links

Top  Previous  Next

The command ID WPDFCOM_ADD_BOOKMARK = 552 can be used to create a bookmark.  The parameter is the the name of the bookmark, the rectangle its destination. The bookmark name can be used for links and outlines. It is not necessary to create the bookmark before it is beeing zused, it can also be created later.

 

    pdf.Canvas.TextOut(100,200, 'Goal!');

    pdf.WriteGDICommentStr(WPDFCOM_ADD_BOOKMARK, Rect(100,200, 100,200), 'DEST');

 

The command ID WPDFCOM_ADD_HYPERLINK = 551 can be used to create a hyperlink.  The parameter is the destination bookmark.

 

    pdf.Canvas.Rectangle(Rect(500,500, 600,600));

    pdf.Canvas.TextOut(500,500, 'Click!');

    pdf.WriteGDICommentStr(WPDFCOM_ADD_HYPERLINK, Rect(500,500, 600,600), 'DEST');