lib/squib/graphics/save_doc.rb in squib-0.5.0 vs lib/squib/graphics/save_doc.rb in squib-0.5.1
- old
+ new
@@ -20,10 +20,11 @@
p = needs(opts, [:range, :paper_width, :paper_height, :file_to_save,
:creatable_dir, :margin, :gap, :trim])
paper_width = p[:width]
paper_height = p[:height]
file = "#{p[:dir]}/#{p[:file]}"
- cc = Cairo::Context.new(Cairo::PDFSurface.new(file, paper_width, paper_height))
+ cc = Cairo::Context.new(Cairo::PDFSurface.new(file, paper_width * 72.0 / @dpi, paper_height * 72.0 / @dpi))
+ cc.scale(72.0 / @dpi, 72.0 / @dpi) # for bug #62
x, y = p[:margin], p[:margin]
card_width = @width - 2 * p[:trim]
card_height = @height - 2 * p[:trim]
@progress_bar.start("Saving PDF to #{file}", p[:range].size) do |bar|
p[:range].each do |i|