Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- document = Nokogiri::XML(File.read(Rails.root.to_s+'/lib/label.xml'))
- template = Nokogiri::XSLT(File.open(Rails.root.to_s+'/lib/xsl_which_imports_more_xsl.xsl','rb'))
- html_document = template.transform(document)
- pdf = WickedPdf.new.pdf_from_string(html_document)
- save_path = Rails.root.join('public','filename.pdf')
- File.open(save_path, 'wb') do |file|
- file << pdf
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement