Integrations
Add PDF generation to your existing tools without writing a single line of code.
WordPress Plugin
The DocRenders WordPress plugin adds a "Download as PDF" button to any post or page — no code required. Site owners install the plugin, enter their API key, and readers get a one-click PDF download of the content.
Installation
- Download the latest
docrenders.zipfrom the GitHub releases page. - In your WordPress admin, go to Plugins → Add New → Upload Plugin and upload the zip.
- Activate the plugin.
- Go to Settings → DocRenders and enter your API key (
dcr_live_…).
Shortcode
Place the shortcode anywhere in a post or page to add a download button:
[docrenders]
Optional attributes let you customize the output:
[docrenders label="Download PDF" template="post" format="A4"]
| Attribute | Default | Description |
|---|---|---|
label | Download PDF | Button label text |
template | post | DocRenders template to use — post for posts/pages |
format | A4 | Page size: A4, Letter, or Legal |
How it works
When a visitor clicks the button, the browser posts to a WordPress REST endpoint registered by the plugin:
POST /wp-json/docrenders/v1/render
The endpoint reads the post content server-side, attaches the stored API key, calls the DocRenders API, and streams the PDF back to the browser. The API key is never exposed to the client.
WooCommerce Invoices
When WooCommerce is active, the DocRenders plugin automatically generates an invoice PDF and attaches it to the order completion email when an order's status changes to Completed. No configuration is needed beyond installing the plugin and setting your API key.
Invoices are rendered using the woo-invoice template. Order data (line items, billing address, totals, payment method) is pulled directly from the WooCommerce order object.
Admin: generate invoice for any order
From WooCommerce → Orders, open any order and click Generate PDF Invoice in the Order Actions panel. The PDF is generated on demand and streamed to the browser.
Customising invoice output
The woo-invoice template is populated automatically from WooCommerce order data. To override any field — for example, to add a custom footer note — use the docrenders_woo_invoice_data filter:
add_filter( 'docrenders_woo_invoice_data', function( $data, $order ) {
$data['notes'] = 'Thank you for shopping with us! Questions? Email support@yourstore.com.';
return $data;
}, 10, 2 );
The $data array contains all fields documented in the woo-invoice template reference.
