2 from pdflib_py import *
6 PDF_open_file(p, "layers2.pdf")
8 PDF_set_parameter(p, "usercoordinates", "true")
9 PDF_set_info(p, "Creator", "layer2.py")
14 PDF_begin_page(p, width, height)
16 PDF_setrgbcolor_fill(p, 0, 0, 1.0)
18 PDF_lineto(p, 100, 10)
19 PDF_lineto(p, 10, 100)
21 PDF_moveto(p, 20, 110)
22 PDF_lineto(p, 110, 110)
23 PDF_lineto(p, 110, 20)
27 x = random.randint(10,110)
28 y = random.randint(200,300)
33 PDF_setrgbcolor_fill(p, 0.5, 0.5, 1.0)
38 PDF_lineto(p, x+50,y+50)
47 PDF_setrgbcolor_fill(p, 0, 1.0, 0)
53 PDF_lineto(p, x+50,y+50)
56 PDF_lineto(p, x+25,y+25)