Class: PdfPrinter
- Inherits:
-
ActionPrinter
- Object
- ActionView::Base
- ActionPrinter
- PdfPrinter
- Defined in:
- lib/oxen_printer/pdf_printer.rb
Instance Attribute Summary
Attributes inherited from ActionPrinter
Instance Method Summary collapse
Methods inherited from ActionPrinter
#build_print_cmd, #command, #command=, #do_print, #html_file, #initialize, #label_file_path, #logit, #mail_print, #pdf_file_path, #print_print, #render_string_in, #send_print_file, #text_file
Constructor Details
This class inherits a constructor from ActionPrinter
Instance Method Details
#do_render(print_job, *args) ⇒ Object
IKKE FÆRDIG
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/oxen_printer/pdf_printer.rb', line 3 def do_render(print_job,*args) # first we will call super to do the html thing html_path = super # # calls java -jar with the oxen_printer gem lib/java_pdf/barcodeprinter.jar - as in java -jar /Users/walther/Projects/Gems/oxen_printer/lib/java_pdf/barcodeprinter.jar $1 $2 var = %x[ bin/printer_cmd.sh #{html_path} #{pdf_file_path} ] logit :info, "converted the html file to a PDF file: #{pdf_file_path}" true rescue => e logit :error, "Rendering to PDF failed! The error was #{e.message}" false end |
#file_path ⇒ Object
16 17 18 |
# File 'lib/oxen_printer/pdf_printer.rb', line 16 def file_path pdf_file_path end |
#get_file_type ⇒ Object
20 21 22 |
# File 'lib/oxen_printer/pdf_printer.rb', line 20 def get_file_type "application/pdf" end |