Skip to main content

Quick Start for Ruby

Ruby supports wkhtmltopdf but relies on Node.js for Puppeteer. Our service bypasses these dependencies, providing straightforward HTML to PDF conversion. Get started with Ruby here.

Get Your API Key

  • Locate your API Key in the Admin Dashboard or check your inbox for the welcome email after signing up.
  • This key is necessary to authenticate your API calls.

Make Your First Request

Use the following example to quickly make a request to the PDFBolt API and generate your first PDF.

require 'net/http'
require 'json'

uri = URI('https://api.pdfbolt.com/v1/direct')
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json', 'API_KEY' => 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX')
req.body = { url: 'https://example.com' }.to_json

res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }

File.write('example.pdf', res.body)

What’s next?

Continue your journey with PDFBolt by exploring its extensive features and benefits. Start by checking the available API Endpoints and reviewing the various Conversion Parameters that can be used to customize your integration. This will help you leverage PDFBolt’s full capabilities and ensure that it aligns with your specific requirements.