2 from pdflib_py
import *
4 PDF_open_file(p
, "textselectspaces.pdf")
6 PDF_set_parameter(p
, "usercoordinates", "true")
8 PDF_set_info(p
, "Creator", "smalltext.py")
9 PDF_begin_page(p
, 612, 200)
10 font
= PDF_load_font(p
, "Helvetica", "host", "")
12 PDF_setfont(p
, font
, 18.0)
18 w
= PDF_stringwidth(p
, s
, font
, 18.0)
21 PDF_set_text_pos(p
, x
, y
)
24 PDF_set_text_pos(p
, x
, y
)
26 write_word("quick", 20)
27 write_word("brown", 20)
31 PDF_set_text_pos(p
, x
, y
)
33 write_word("quick", 10)
34 write_word("brown", 10)
38 PDF_set_text_pos(p
, x
, y
)
40 write_word("quick", 1)
41 write_word("brown", 1)
44 PDF_setmatrix(p
, 2.5, 0, 0, 1.0, 0, 0)
46 PDF_set_text_pos(p
, x
, y
)
47 write_word("The", 0.5)
48 write_word("quick", 0.5)
49 write_word("brown", 0.5)
50 write_word("fox", 0.5)
52 PDF_setmatrix(p
, 2.5, 0, 0, 1.0, 0, 0)
54 PDF_set_text_pos(p
, x
, y
)
56 write_word("quick", 5)
57 write_word("brown", 5)