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.
1️⃣ Get Your API Key
- After registering, log in to the Admin Dashboard and navigate to the API Keys section to retrieve your API key.
- Ensure you keep this key secure, as it is essential for authorizing your requests to the PDFBolt API.
2️⃣ 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'));
});
3️⃣ What’s next?
Continue your journey with PDFBolt by exploring its powerful features and benefits. Start by checking the available API Endpoints and dive into the Conversion Parameters to customize your integration for your unique needs.