Merge branch 'master' of git.swftools.org:/home/git/swftools-internal
[swftools.git] / spec / links.py
blob39e44cd00645fafd857d40cae6d5ca56908f3b92
1 from sys import *
2 from pdflib_py import *
3 p = PDF_new()
4 PDF_open_file(p, "links.pdf")
6 PDF_set_parameter(p, "usercoordinates", "true")
7 PDF_set_info(p, "Creator", "links.py")
9 width=200
10 height=200
12 PDF_begin_page(p, width, height)
13 def draw_link(x1,y1,x2,y2,url):
14 action = PDF_create_action(p, "URI", "url="+url);
15 optlist = "action={activate "+str(action)+"} linewidth=5"
16 PDF_create_annotation(p, x1,y1,x2,y2, "Link", optlist);
17 draw_link(0, 0, 100, 100, "http://www.swftools.org")
18 draw_link(0, 100, 100, 200, "http://www.quiss.org")
19 PDF_end_page(p)
21 PDF_begin_page(p, width, height)
22 draw_link(0, 0, 100, 100, "http://www.pdf2swf.org")
23 PDF_end_page(p)
25 PDF_close(p)
26 PDF_delete(p);