Monday 1 July 2019

Creating PDF with links

Livecode permits you to print any part of your programs as a PDF (or on a real printer).
If you want, you can create a PDF with links. The command to use is print link.
For example on a window create a text (http://www.paypal.com) and the use Text-> Link menu. Like this:




For example the button code is:

on mouseUp
   set the printPaperSize to (item 3 to 4 of the rect of this stack)
   put the rect of field "example" into temp
   ask file "Save PDF as:" with "Example.pdf"   
   if it is empty then
      exit mouseUp
   end if
   open printing to PDF it   
   print card 1 of this stack   
   print link to URL "http://www.paypal.com/" with rect temp
   close printing
end mouseUp

This is the result in a PDF reader:


No comments:

Post a Comment