3 pdf = GFX::PDF.new('test.pdf')
5 class TestRender < GFX::Device
6 def startpage(width,height)
7 puts "startpage(#{width},#{height})"
12 def setparameter(key,value)
13 puts "setparameter(#{key},#{value})"
16 puts "startclip(#{line})"
21 def stroke(line, width, color, cap_style, joint_style, miterLimit)
22 puts "stroke(#{line}, #{width}, #{color}, #{cap_style}, #{joint_style}, #{miterLimit})"
25 puts "fill(#{line}, #{color})"
27 def fillbitmap(line, img, imgcoord2devcoord, cxform)
28 puts "fillbitmap(#{line}, #{img}, #{imgcoord2devcoord}, #{cxform})"
30 def fillgradient(dev, line, gradient, type, gradcoord2devcoord)
31 puts "fillgradient(#{line}, #{gradient}, #{type}, #{gradcoord2devcoord})"
36 puts "addfont(#{font})"
38 def drawchar(font, glyph, color, matrix)
39 puts "drawchar(#{font}, #{glyph}, #{color}, #{matrix})"
41 def drawlink(line, action)
42 puts "drawchar(#{line}, #{action})"
47 pdf.each_page do |page|
48 puts "#{page.nr} #{page.width}x#{page.height}"