1 import sys
; sys
.path
.insert(0, "../..")
4 from PIL
.Image
import open
6 print("PIL not available, skipping palette test")
9 paletteimage
= open("../../www/vcss.png")
11 image_bw
= bitmap
.image(2, 2, "L", b
"\0\377\377\0")
12 image_rgb
= bitmap
.image(3, 2, "RGB", b
"\77\77\77\177\177\177\277\277\277"
13 b
"\377\0\0\0\377\0\0\0\377")
15 bitmap_bw_stream
= bitmap
.bitmap(0, 1, image_bw
, height
=0.8)
16 bitmap_rgb_stream
= bitmap
.bitmap(0, 0, image_rgb
, height
=0.8)
18 bitmap_bw_storestring
= bitmap
.bitmap(2, 1, image_bw
, height
=0.8, PSstoreimage
=1)
19 bitmap_rgb_storestring
= bitmap
.bitmap(2, 0, image_rgb
, height
=0.8, PSstoreimage
=1)
21 bitmap_bw_storearray
= bitmap
.bitmap(4, 1, image_bw
, height
=0.8, PSstoreimage
=1, PSmaxstrlen
=2)
22 bitmap_rgb_storearray
= bitmap
.bitmap(4, 0, image_rgb
, height
=0.8, PSstoreimage
=1, PSmaxstrlen
=2)
25 c
.insert(bitmap_bw_stream
)
26 c
.insert(bitmap_rgb_stream
)
27 c
.insert(bitmap_bw_storestring
)
28 c
.insert(bitmap_rgb_storestring
)
29 c
.insert(bitmap_bw_storearray
)
30 c
.insert(bitmap_rgb_storearray
)
32 c
.insert(bitmap
.bitmap(6, 0, paletteimage
, height
=1.8))
33 c
.writeEPSfile("test_bitmap", page_paperformat
=document
.paperformat
.A4
)
34 c
.writePDFfile("test_bitmap", page_paperformat
=document
.paperformat
.A4
)
35 c
.writeSVGfile("test_bitmap", page_paperformat
=document
.paperformat
.A4
)