3 class TestRender < GFX::Device
4 def startpage(width,height)
5 puts "startpage(#{width},#{height})"
10 def setparameter(key,value)
11 puts "setparameter(#{key},#{value})"
14 puts "startclip(#{line.inspect})"
19 def stroke(line, width, color, cap_style, joint_style, miterLimit)
20 puts "stroke(#{line.inspect}, #{width}, #{color.inspect}, #{cap_style}, #{joint_style}, #{miterLimit})"
23 puts "fill(#{line.inspect}, #{color.inspect})"
25 def fillbitmap(line, img, imgcoord2devcoord, cxform)
26 puts "fillbitmap(#{line.inspect}, #{img}, #{imgcoord2devcoord}, #{cxform})"
28 def fillgradient(dev, line, gradient, type, gradcoord2devcoord)
29 puts "fillgradient(#{line.inspect}, #{gradient}, #{type}, #{gradcoord2devcoord})"
32 puts "addfont(#{font.name})"
34 def drawchar(font, glyph, color, matrix)
35 puts "drawchar(#{font.name}, #{glyph}, #{color.inspect}, #{matrix.inspect})"
37 def drawlink(line, action)
38 puts "drawchar(#{line.inspect}, #{action})"
42 pdf = GFX::PDF.new('abcdef.pdf')
44 pdf.render(r, "1-5", [:remove_font_transforms])