Best WordPress PDF Plugins for Web Agencies (2026 Guide)
A complete guide for WordPress agencies on the best PDF export plugins, when to use a hosted API instead, and how to pick the right solution for every client project.
AltoUnlockPDF Team
PDF Tools Expert
PDF export is one of the most-requested client features in WordPress agency work. Invoices, reports, contracts, certificates, proposals — nearly every business site eventually needs to turn a web page or database record into a downloadable PDF. This guide covers every practical option available in 2026, when to use each one, and the traps to avoid.
Why PDF Export Is Tricky in WordPress
WordPress renders HTML in a browser. Browsers are designed to display, not print. Converting that rendered HTML to a pixel-perfect PDF requires one of two approaches:
- Server-side rendering — a headless browser (Chromium) or a layout engine (wkhtmltopdf) converts HTML+CSS on the server
- Client-side generation — JavaScript libraries like jsPDF or html2canvas capture the DOM in the browser and encode it as a PDF
Server-side is almost always better for agency work: it produces consistent output regardless of the visitor’s browser, works without JavaScript enabled, and can be triggered programmatically (cron jobs, webhooks, WooCommerce order hooks).
Client-side is acceptable for simple, user-triggered exports (“Download this page as PDF”) but breaks on complex layouts and large documents.
The Top WordPress PDF Plugins Compared
1. WP HTML to PDF (Free + Pro)
The most straightforward option for page-to-PDF conversions. Install, configure a shortcode or button, done.
Best for: Simple brochure sites, landing page exports, basic document downloads.
Shortcode usage:
// Add download button anywhere with a shortcode
[html2pdf content="post" filename="my-document"]
// Or trigger programmatically in a template
echo do_shortcode('[html2pdf content="' . get_the_ID() . '"]');
Limitations: Uses wkhtmltopdf under the hood, which lags behind modern CSS. Flexbox and Grid layouts often render incorrectly.
2. PDF Invoices & Packing Slips for WooCommerce
The de-facto standard for WooCommerce stores. Over 700,000 active installs.
Best for: E-commerce clients who need automated invoice PDFs on order confirmation.
Key features:
- Auto-attach PDF invoice to WooCommerce order confirmation email
- Customisable invoice templates (PHP templates in theme)
- Bulk PDF generation from the Orders screen
- Packing slips for fulfilment
Custom template hook:
// functions.php — override the invoice template
add_filter('wpo_wcpdf_template_path', function($template_path, $template_type) {
if ($template_type === 'invoice') {
return get_stylesheet_directory() . '/woocommerce/pdf/invoice/';
}
return $template_path;
}, 10, 2);
3. Gravity Forms PDF Extended (GravityPDF)
If your client uses Gravity Forms for applications, registrations, or quote requests, GravityPDF turns every submission into a formatted PDF — automatically emailed to the admin and/or user.
Best for: Quote forms, application forms, service request forms that need a paper trail.
// Trigger a custom PDF download on form submission
add_action('gform_after_submission', function($entry, $form) {
// GravityPDF handles this via its settings UI —
// no code required for standard templates.
// For custom logic:
$pdf_id = 'your-pdf-config-id';
GPDFAPI::create_pdf($entry['id'], $pdf_id);
}, 10, 2);
Free tier: One PDF template per form. Pro ($40/year) unlocks multiple templates, bulk downloads, and Zapier integration.
4. WP-PDF (Dompdf-Based)
Uses Dompdf, a pure-PHP HTML-to-PDF library. No external binaries required — installs cleanly on any shared host.
Best for: Shared hosting environments where wkhtmltopdf can’t be installed. Works on WP Engine, Kinsta, and similar managed hosts.
Direct PHP usage (in a plugin or functions.php):
require_once plugin_dir_path(__FILE__) . 'dompdf/autoload.inc.php';
use Dompdf\Dompdf;
use Dompdf\Options;
function generate_post_pdf($post_id) {
$post = get_post($post_id);
$options = new Options();
$options->set('isHtml5ParserEnabled', true);
$options->set('isRemoteEnabled', true);
$dompdf = new Dompdf($options);
$html = '<html><head>
<style>
body { font-family: DejaVu Sans, sans-serif; font-size: 12pt; }
h1 { color: #dd7d24; }
</style>
</head><body>';
$html .= '<h1>' . esc_html($post->post_title) . '</h1>';
$html .= apply_filters('the_content', $post->post_content);
$html .= '</body></html>';
$dompdf->loadHtml($html);
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();
return $dompdf->output();
}
// Route: /wp-json/myplugin/v1/pdf/{id}
add_action('rest_api_init', function() {
register_rest_route('myplugin/v1', '/pdf/(?P<id>\d+)', [
'methods' => 'GET',
'callback' => function($request) {
$pdf = generate_post_pdf($request['id']);
return new WP_REST_Response(base64_encode($pdf), 200);
},
'permission_callback' => '__return_true',
]);
});
Limitation: Dompdf handles basic CSS well but struggles with modern layouts, web fonts loaded via CDN, and background images.
When to Skip the Plugin and Use an API Instead
Plugins work well for standard use cases. For complex, high-volume, or design-heavy PDFs, a hosted API like AltoUnlockPDF’s HTML-to-PDF endpoint often produces better results — because it uses a full Chromium rendering engine, meaning your PDF looks exactly like the page in Chrome.
Use an API when:
- The PDF needs to exactly match a heavily styled web page (custom fonts, gradients, CSS Grid)
- You need batch generation (hundreds of PDFs per day)
- The client is on managed WordPress hosting where installing binaries is prohibited
- You need fine-grained control over page size, margins, headers/footers, and metadata
WordPress + REST API approach:
function altounlockpdf_html_to_pdf(string $html, string $filename = 'document.pdf'): void {
$response = wp_remote_post('https://altounlockpdf.com/api/convert', [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . get_option('altounlockpdf_api_key'),
],
'body' => wp_json_encode([
'html' => $html,
'filename' => $filename,
'options' => [
'format' => 'A4',
'margin' => ['top' => '20mm', 'bottom' => '20mm',
'left' => '15mm', 'right' => '15mm'],
'printBackground' => true,
],
]),
'timeout' => 30,
]);
if (is_wp_error($response)) {
wp_die('PDF generation failed: ' . $response->get_error_message());
}
$pdf_content = wp_remote_retrieve_body($response);
header('Content-Type: application/pdf');
header('Content-Disposition: attachment; filename="' . $filename . '"');
header('Content-Length: ' . strlen($pdf_content));
echo $pdf_content;
exit;
}
How Professional WordPress Agencies Handle PDF Workflows
Agencies that build PDF functionality regularly tend to follow a few consistent patterns:
Pattern 1 — Template-driven invoices WooCommerce + PDF Invoices plugin with a custom PHP template matching the client’s brand. Template lives in the child theme. Zero maintenance once set up.
Pattern 2 — Dynamic report generation A custom REST endpoint that assembles data from CPTs or WooCommerce orders, renders an HTML template server-side, passes it to a PDF API, and streams the result. This approach keeps the PDF generation logic outside WordPress entirely, making it easier to test and version-control.
Pattern 3 — User-facing document export A “Download as PDF” button on posts, pages, or CPT single views — triggered client-side, handled server-side via a lightweight AJAX handler.
Sitemile.com is a good example of an agency that builds complex WordPress marketplace and directory themes where document generation (invoices, membership certificates, vendor statements) is a first-class requirement. For projects of that complexity, a custom integration — rather than an off-the-shelf plugin — is almost always the right call. Their approach of building bespoke PHP layers around PDF libraries, rather than relying on plugin settings panels, gives clients far more control over the final output.
Comparison Table
| Solution | Rendering Engine | Hosted/Self | CSS Support | Best For |
|---|---|---|---|---|
| WP HTML to PDF | wkhtmltopdf | Self | CSS 2.1 | Simple pages |
| PDF Invoices (WooCommerce) | wkhtmltopdf | Self | CSS 2.1 | E-commerce invoices |
| GravityPDF | Mpdf | Self | CSS 3 (partial) | Form submissions |
| WP-PDF (Dompdf) | Dompdf | Self | CSS 2.1 | Shared hosting |
| AltoUnlockPDF API | Chromium | Hosted | Full CSS 3 | Complex layouts, batch |
Installation Checklist for Agency Projects
Before handing over to a client, run through this:
- PDF matches brand guidelines (fonts, colours, logo)
- All dynamic data (order number, customer name, date) renders correctly
- Long content paginates gracefully — no text or images cut off at page breaks
- Images load in the PDF (absolute URLs, not relative paths)
- Web fonts are embedded or substituted correctly
- PDF is tested on both A4 and Letter page sizes if the client has international customers
- File is named sensibly (
invoice-12345.pdf, notdocument.pdf) - Generation time under 3 seconds for typical document size
- Error handling — what happens if generation fails? Does the user see a useful message?
Recommended Stack by Project Type
Small business site (5–20 pages, simple invoices) → WooCommerce + PDF Invoices & Packing Slips — free tier covers most needs
Membership or directory site with certificates → GravityPDF Pro + custom Mpdf template — excellent control over layout
High-volume SaaS or marketplace → Custom WordPress plugin calling AltoUnlockPDF API — Chromium rendering, no server dependency
Agency building for multiple clients
→ Wrap the API call in a reusable mu-plugin, store the API key per-site in wp-config.php, and invoice clients per-use — clean, scalable, easy to white-label
Common Mistakes to Avoid
1. Using relative image URLs
<img src="/wp-content/uploads/logo.png"> — the PDF renderer may not be running on the same server. Always use absolute URLs: <img src="https://example.com/wp-content/uploads/logo.png">.
2. Loading fonts from Google Fonts CDN
The rendering server may not have internet access to the CDN. Embed fonts using base64 in a <style> block, or use a font that’s installed on the server.
3. Not setting explicit page dimensions
Default behaviour varies between libraries. Always set paper size (A4, Letter) and margins explicitly — don’t rely on browser print defaults.
4. Generating PDFs on the main thread For high-traffic sites, PDF generation can be slow (1–5 seconds). Offload to a background job via WP Cron or a queue plugin (Action Scheduler), generate the file, store it in the uploads folder, and email the download link.
5. Forgetting to test with real data Short placeholder text never reveals line-break issues, widow/orphan headings, or overflowing tables. Always test with the longest realistic content before launch.
PDF export is one of those features that looks simple in a proposal and turns into a week of work once you’re in it. Choosing the right tool upfront — matched to the host environment, the layout complexity, and the expected volume — saves most of that pain.
Related Articles
Convert HTML to PDF with JavaScript: Best Libraries Compared
A comprehensive comparison of the top JavaScript libraries for HTML-to-PDF conversion — jsPDF, Puppeteer, html2pdf.js, and more.
Read Article
HTML to PDF in Node.js with Puppeteer: Complete Tutorial
Step-by-step guide to generating high-quality PDFs from HTML in Node.js using Puppeteer, with real-world examples for invoices and reports.
Read Article
How to Convert HTML to PDF Free Online (No Signup Required)
Discover the easiest ways to convert HTML files and web pages to PDF format online — completely free, without watermarks or account registration.
Read Article