Generate PDFs from Node.js using an async first SDK that fits Express, Next.js, and serverless functions. Convert HTML or URLs into PDFs that render with modern CSS.
import { GeneratePDFs } from '@generatepdfs/node-sdk';
const client = GeneratePDFs.connect('YOUR_API_TOKEN');
// Generate from HTML file with CSS
const pdf = await client.generateFromHtml(
'/path/to/file.html',
'/path/to/file.css'
);
// Or from a URL
const pdf = await client.generateFromUrl('https://example.com');
from generatepdfs import GeneratePDFs
client = GeneratePDFs.connect('YOUR_API_TOKEN')
# Generate from HTML file with CSS
pdf = client.generate_from_html(
'/path/to/file.html',
'/path/to/file.css'
)
# Or from a URL
pdf = client.generate_from_url('https://example.com')
<?php
use GeneratePDFs\GeneratePDFs;
$client = GeneratePDFs::connect('YOUR_API_TOKEN');
// Generate from HTML file with CSS
$pdf = $client->generateFromHtml(
'/path/to/file.html',
'/path/to/file.css'
);
// Or from a URL
$pdf = $client->generateFromUrl('https://example.com');
<?php
use GeneratePDFs\Laravel\Facades\GeneratePDFs;
// Generate from HTML file with CSS
$pdf = GeneratePDFs::generateFromHtml(
'/path/to/file.html',
'/path/to/file.css'
);
// Or from a URL
$pdf = GeneratePDFs::generateFromUrl('https://example.com');
require 'generatepdfs'
client = GeneratePDFs::GeneratePDFs.connect('YOUR_API_TOKEN')
# Generate from HTML file with CSS
pdf = client.generate_from_html(
'/path/to/file.html',
'/path/to/file.css'
)
# Or from a URL
pdf = client.generate_from_url('https://example.com')
Render HTML from React, Handlebars, or static templates, then await the SDK call. The browser based renderer keeps modern CSS features aligned with your front end. For HTML to PDF conversion, see the main guide.
Send a URL to convert pages into PDFs for reports, invoices, or account pages. This works well for Vercel, Netlify, and AWS Lambda deployments.
Generate PDFs in workers using BullMQ, RabbitMQ, or queue services, then store the result in S3 or object storage. If you use Puppeteer or Playwright for PDFs, see the Alternative to Puppeteer PDF and Alternative to Playwright PDF pages. Use server side PDF generation without browser infrastructure. Use the PDF generation API with the Node SDK.
await generateFromHtml or generateFromUrl inside an async handler.Promise based calls fit async routes and serverless handlers.
Skip Chromium installs and keep deploys smaller.
Modern HTML and CSS render the same in the PDF.
Generate PDFs in Next.js or Lambda without local binaries.
Convert HTML dashboards and charts into PDFs.
Create account statements and onboarding PDFs on demand.
Use the Node.js SDK to convert HTML or URLs into PDFs that keep your fonts, colours, and layout.