This was created when I had to much problems with other known pdf tool libraries for merging and create pdf files from html.
This gem are using following java libs pdf-merger and html-to-pdf
This gem is tested on rails 4.0.5 with ruby 2.1.1
At the moment before any tests are written and tested in production install it from github
gem 'pdftool', github: "agowan/pdftool"
Without fonts
generator = Pdf::Generator.new "<body><strong>Hello World</strong></body>"
generator.save('path/to/file.pdf')
With fonts
generator = Pdf::Generator.new "<body><strong>Hello World</strong></body>", "path/to/font1.ttf", "path/to/font2.ttf"
generator.save('path/to/file.pdf')
# Returns the pdf inline
generator.to_pdf
merger = Pdf::Merger.new 'path/to/file_1.pdf', 'path/to/file_2.pdf'
merger.save('path/to/file.pdf')
You can also get the file inline.
merger.to_pdf
- For it
- Add your code
- Create a pull request