Project

evil_pdf

0.0
No commit activity in last 3 years
No release in over 3 years
Generate a PDF from an array of URLs
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

EvilPDF¶ ↑

Generate a PDF file from an array of URLs

Usage¶ ↑

# this is here for clarity, this record creation can be internalized into EvilPDF
pdf_record = PdfRecord.new :name => 'file_name_no_ext'

evil_pdf = EvilPdf.new pdf_record,
  :async => true, # run in delayed job, updates record automatically

evil_pdf.from_urls ['http://google.com']

# save to db manually
pdf_record.pdf = evil_pdf.file_handle
pdf_record.save

# immediate download, must not be async
send_file evil_pdf.file_path, 
  :type => "application/pdf", 
  :disposition => "inline"

Dependencies¶ ↑

  • PDFKit wrapper

  • wkhtmltopdf binary (included in PDFKit)

  • Ghostscript to combine PDFs into one file (included in most *nix systems)

  • delayed_job