mirror of
https://github.com/lloeki/tilt-pdf-rails.git
synced 2025-12-06 02:24:42 +01:00
rudimentary command line generator tool
This commit is contained in:
parent
1bce8e08ea
commit
5c842de162
1 changed files with 12 additions and 0 deletions
12
bin/rpdf
Executable file
12
bin/rpdf
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
$LOAD_PATH.push File.expand_path(File.join(__FILE__, '../..'))
|
||||
|
||||
require 'tilt-pdf'
|
||||
require 'slim'
|
||||
|
||||
rpdf = ARGV.shift or fail('usage: rpdf filename')
|
||||
pdf = Tilt.new(rpdf).render
|
||||
File.open(File.basename(rpdf, '.rpdf') + '.pdf', 'wb') do |f|
|
||||
f.write(pdf)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue