Skip to main content

Quick Start for Ruby

Ruby supports wkhtmltopdf but requires Node.js for Puppeteer. PDFBolt eliminates these dependencies, offering a simple and efficient solution for HTML to PDF conversion. Get started with Ruby here.

1️⃣ Get Your API Key

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

2️⃣ 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)

3️⃣ What’s next?

Discover how PDFBolt can streamline your workflows. Start by exploring the API Endpoints and dive into the Conversion Parameters to customize your integration.