Sha256: f8b741332cf03dd2ebcbe8055e50a72670f848a8ca3f5e0c1438004617f9cfcd

Contents?: true

Size: 661 Bytes

Versions: 7

Compression:

Stored size: 661 Bytes

Contents

# frozen_string_literal: true

$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "breezy_pdf_lite"
require "fileutils"

html = File.read(File.expand_path("ex.html", __dir__))

BreezyPDFLite.setup do |config|
  config.secret_api_key = ENV["BREEZYPDF_SECRET_API_KEY"]
  config.base_url = ENV.fetch("BREEZYPDF_BASE_URL", "http://localhost:5001")
  config.middleware_path_matchers = [/as-pdf.pdf/]
end

render_request = BreezyPDFLite::RenderRequest.new(html)

begin
  tempfile = render_request.to_file
  puts tempfile.path
  puts "Enter to remove..."
  gets
rescue BreezyPDFLite::BreezyPDFLiteError => e
  puts "Unable to render PDF: #{e.message}"
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
breezy_pdf_lite-0.1.1 example/pragmatic.rb
breezy_pdf_lite-0.1.0 example/pragmatic.rb
breezy_pdf_lite-0.0.7 example/pragmatic.rb
breezy_pdf_lite-0.0.6 example/pragmatic.rb
breezy_pdf_lite-0.0.4 example/pragmatic.rb
breezy_pdf_lite-0.0.3 example/pragmatic.rb
breezy_pdf_lite-0.0.2 example/pragmatic.rb