2 from pdflib_py
import *
3 from math
import sin
,cos
5 PDF_open_file(p
, "imagematrix.pdf")
7 PDF_set_parameter(p
, "usercoordinates", "true")
11 PDF_begin_page(p
, width
, height
)
15 matrices
= [[1,0,0,1,100,200],
16 [cos(a
),sin(a
),-sin(a
),cos(a
),400,75],
19 [1.9,0.5,0.6,1.4,50,-200],
20 [cos(b
),sin(b
),sin(b
),-cos(b
),500,630],
24 i
= PDF_load_image(p
, "png", "karo.png", "")
28 PDF_setmatrix(p
, m
[0],m
[1],m
[2],m
[3],m
[4],m
[5])
31 #PDF_fit_image(p, i, x, y, "")
32 PDF_place_image(p
, i
, x
, y
, 100/4)
35 PDF_setrgbcolor_fill(p
, 0.0, 1.0, 1.0)
38 PDF_lineto(p
, x
+w
,y
+h
)
41 PDF_moveto(p
, x
-20,y
-20)
42 PDF_lineto(p
, x
-20,y
+20+h
)
43 PDF_lineto(p
, x
+20+w
,y
+20+h
)
44 PDF_lineto(p
, x
+20+w
,y
-20)
45 PDF_lineto(p
, x
-20,y
-20)