3 #pdf = GFX::PDF.new('test.pdf')
4 pdf = GFX::PDF.new('/home/kramm/paper5.pdf')
6 class TestRender < GFX::Device
7 def startpage(width,height)
8 puts "startpage(#{width},#{height})"
13 def setparameter(key,value)
14 puts "setparameter(#{key},#{value})"
17 puts "startclip(#{line.inspect})"
22 def stroke(line, width, color, cap_style, joint_style, miterLimit)
23 puts "stroke(#{line.inspect}, #{width}, #{color.inspect}, #{cap_style}, #{joint_style}, #{miterLimit})"
26 puts "fill(#{line.inspect}, #{color.inspect})"
28 def fillbitmap(line, img, imgcoord2devcoord, cxform)
29 puts "fillbitmap(#{line.inspect}, #{img}, #{imgcoord2devcoord}, #{cxform})"
31 def fillgradient(dev, line, gradient, type, gradcoord2devcoord)
32 puts "fillgradient(#{line.inspect}, #{gradient}, #{type}, #{gradcoord2devcoord})"
35 puts "addfont(#{font.name})"
37 def drawchar(font, glyph, color, matrix)
38 puts "drawchar(#{font.name}, #{glyph}, #{color.inspect}, #{matrix.inspect})"
40 def drawlink(line, action)
41 puts "drawchar(#{line.inspect}, #{action})"
46 pdf.each_page do |page|
47 puts "#{page.nr} #{page.width}x#{page.height}"