Sha256: 3e06f6a69bdb3dd1341f01a1a8420864c2abfc477d4dbd2614f857742b9c3da4
Contents?: true
Size: 567 Bytes
Versions: 2
Compression:
Stored size: 567 Bytes
Contents
require "bundler/setup" Bundler.require DocRaptor.configure do |dr| dr.username = "YOUR_API_KEY_HERE" # dr.debugging = true end $docraptor = DocRaptor::DocApi.new output_file = "ruby-sync.pdf" output_payload = $docraptor.create_doc( test: true, document_content: "<html><body>Hello from Ruby</body></html>", name: output_file, document_type: "pdf", ) File.write(output_file, output_payload) output_type = `file -b #{output_file}` File.delete output_file raise "Output was not a PDF" unless output_type.start_with?("PDF")
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
docraptor-2.0.0 | test/sync.rb |
docraptor-1.4.0 | test/sync.rb |