Skip to main content

Quick Start for Node.js

Both wkhtmltopdf and Puppeteer are well-supported in Node.js, though they can be complex to configure for specific needs. Our service provides a quicker, easier way to convert HTML to PDF. Here’s how to start in Node.js.

Get Your API Key

  • Retrieve your API Key from the Admin Dashboard or the welcome email you received after signing up.
  • This key is essential for authenticating your requests to the PDFBolt API.

Make Your First Request

Follow the example below to send a basic request to the PDFBolt API and generate your first PDF effortlessly.

const axios = require('axios');
const fs = require('fs');

axios.post(
'https://api.pdfbolt.com/v1/direct',
{ url: 'https://example.com' },
{
headers: {
'Content-Type': 'application/json',
'API_KEY': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
},
responseType: 'stream'
}
).then(response => {
response.data.pipe(fs.createWriteStream('example.pdf'));
});

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.