PDF::Writer:#polygon
まんま
require 'pdf/writer' pdf = PDF::Writer.new points = [ [ 10, 10 ], # starting point [ 20, 20, :curve ], # first control point [ 30, 30 ], # second control point [ 40, 40 ], # ending point of the curve. ] pdf.polygon(points) pdf.stroke File.open("2008020100.pdf", "wb") { |f| f.write pdf.render }
や
require 'pdf/writer' pdf = PDF::Writer.new points = [ [ 10, 10 ], # starting point and first control point [ 20, 20, :scurve ], # second control point [ 30, 30 ], # ending point of the curve. ] pdf.polygon(points) pdf.stroke File.open("2008020101.pdf", "wb") { |f| f.write pdf.render }
や
require 'pdf/writer' pdf = PDF::Writer.new points = [ [ 10, 10 ], # starting point [ 20, 20, :ecurve ], # first control point [ 30, 30 ], # ending point and second control point ] pdf.polygon(points) pdf.stroke File.open("2008020102.pdf", "wb") { |f| f.write pdf.render }
や
require 'pdf/writer' pdf = PDF::Writer.new points = [ [ 10, 10 ], # starting point [ 20, 20, :line ], # ending point ] pdf.polygon(points) pdf.stroke File.open("2008020103.pdf", "wb") { |f| f.write pdf.render }
このコードじゃ違いが分からない…。直線で polygon というのも分からないし