# @option opts file [String] the name of the PDF file to save. See {file:README.md#Specifying_Files Specifying Files}
# @option opts file [String] the name of the PDF file to save. See {file:README.md#Specifying_Files Specifying Files}
# @option opts dir [String] (_output) the directory to save to. Created if it doesn't exist.
# @option opts dir [String] (_output) the directory to save to. Created if it doesn't exist.
# @option opts margin [Integer] (75) the margin around the outside of the page
# @option opts width [Integer] (3300) the height of the page in pixels. Default is 11in * 300dpi. Supports unit conversion.
# @option opts gap [Integer] (0) the space in pixels between the cards
# @option opts height [Integer] (2550) the height of the page in pixels. Default is 8.5in * 300dpi. Supports unit conversion.
# @option opts trim [Integer] (0) the space around the edge of each card to trim (e.g. to cut off the bleed margin for print-and-play)
# @option opts margin [Integer] (75) the margin around the outside of the page. Supports unit conversion.
# @option opts gap [Integer] (0) the space in pixels between the cards. Supports unit conversion.
# @option opts trim [Integer] (0) the space around the edge of each card to trim (e.g. to cut off the bleed margin for print-and-play). Supports unit conversion.
@progress_bar.start("Saving PDF to #{p[:dir]}/#{p[:file]}",p[:range].size)do|bar|
@progress_bar.start("Saving PDF to #{p[:dir]}/#{p[:file]}",p[:range].size)do|bar|
@ -27,10 +28,10 @@ module Squib
cc.paint
cc.paint
bar.increment
bar.increment
x+=surface.width+p[:gap]
x+=surface.width+p[:gap]
ifx>(width-surface.width-p[:margin])
ifx>(p[:width]-surface.width-p[:margin])
x=p[:margin]
x=p[:margin]
y+=surface.height+p[:gap]
y+=surface.height+p[:gap]
ify>(height-surface.height-p[:margin])
ify>(p[:height]-surface.height-p[:margin])
x=p[:margin]
x=p[:margin]
y=p[:margin]
y=p[:margin]
cc.show_page#next page
cc.show_page#next page
@ -51,7 +52,7 @@ module Squib
# @option opts [String] prefix (card_) the prefix of the file name(s)
# @option opts [String] prefix (card_) the prefix of the file name(s)
# @option opts [String] count_format (%02d) the format string used for formatting the card count (e.g. padding zeros). Uses a Ruby format string (see the Ruby doc for Kernel::sprintf for specifics)
# @option opts [String] count_format (%02d) the format string used for formatting the card count (e.g. padding zeros). Uses a Ruby format string (see the Ruby doc for Kernel::sprintf for specifics)
# @option opts dir [String] (_output) the directory to save to. Created if it doesn't exist.
# @option opts dir [String] (_output) the directory to save to. Created if it doesn't exist.
# @option opts margin [Integer] (0) the margin around the outside of the page
# @option opts margin [Integer] (0) the margin around the outside of the page.
# @option opts gap [Integer] (0) the space in pixels between the cards
# @option opts gap [Integer] (0) the space in pixels between the cards
# @option opts trim [Integer] (0) the space around the edge of each card to trim (e.g. to cut off the bleed margin for print-and-play)
# @option opts trim [Integer] (0) the space around the edge of each card to trim (e.g. to cut off the bleed margin for print-and-play)