=== DocRenders – PDF Download Button ===
Contributors: jwhist
Tags: pdf, download, print, woocommerce, invoice
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a "Download PDF" button to any post or page — powered by the DocRenders API.

== Description ==

DocRenders lets your visitors download a clean, print-ready PDF of any post or page with a single click. Connect your [DocRenders](https://docrenders.com) API key, place the button with a shortcode or Gutenberg block, and you're done.

**Features**

* One-click PDF download for posts, pages, or any custom post type
* Shortcode `[docrenders_pdf]` — drop it anywhere in your content
* **Gutenberg block** — insert the PDF button from the block inserter
* Configurable button label and placement
* Usage meter in the settings page so you always know where you stand
* Free plan includes a small "PDF generated by DocRenders" footer; upgrade to remove it

**WooCommerce (optional)**

When WooCommerce is active, a separate settings section appears that lets you automatically attach a PDF invoice to the customer-completed-order email.

**How it works**

DocRenders sends your post HTML to the DocRenders rendering service and streams the resulting PDF directly to the visitor's browser — no files are stored on your server.

A free API key is available at [docrenders.com](https://docrenders.com).

== Installation ==

1. Upload the `docrenders` folder to `/wp-content/plugins/`, or install directly from the WordPress Plugin Directory.
2. Activate the plugin from the **Plugins** screen.
3. Go to **Settings → DocRenders** and paste your API key.
4. Add `[docrenders_pdf]` to any post or page, or insert the **PDF Download Button** block from the Gutenberg block inserter.

== Frequently Asked Questions ==

= Do I need an account? =

Yes. A free account at [docrenders.com](https://docrenders.com) gives you an API key and a monthly render allowance.

= What does the free plan include? =

The free plan includes a set number of PDF renders per month. Generated PDFs include a small "PDF generated by DocRenders" footer. Upgrading to a paid plan removes the footer and increases your render limit.

= Does this work with page builders? =

The shortcode `[docrenders_pdf]` works wherever shortcodes are supported. The Gutenberg block works in the standard WordPress editor.

= Does this work with WooCommerce? =

Yes. When WooCommerce is active, an optional invoice section appears in the settings. You can attach a PDF invoice to the customer-completed-order email automatically.

= Are PDFs stored on my server? =

No. PDFs are streamed directly to the visitor's browser. Nothing is written to your server's filesystem.

= Which PHP version is required? =

PHP 8.1 or higher.

== External services ==

This plugin connects to the DocRenders API to generate PDFs. No PDF files are stored on your server — they are streamed directly to the visitor's browser.

**Endpoints used:**

* `/render` — called whenever a visitor clicks the PDF download button or a WooCommerce invoice is generated. Sends the post/page HTML (or invoice data) and your API key.
* `/usage` — called periodically from the admin settings page to display your monthly render count. Sends only your API key.

**Data sent:** post or page HTML content, invoice field values (shop name, address, order details), API key (as a Bearer token), and optional rendering options (page format, margins).

This service is provided by DocRenders.
`Terms of Service: https://docrenders.com/terms`
`Privacy Policy: https://docrenders.com/privacy`

== Screenshots ==

1. Settings page — enter your API key and configure button behaviour.
2. The PDF Download Button block in the Gutenberg editor.
3. A shortcode-placed button on the front end.
4. Example PDF output.

== Changelog ==

= 1.0.2 =
* Removed custom CSS field per WordPress.org plugin review guidelines.
* Added external services documentation (Terms of Service and Privacy Policy links).
* Added jwhist to Contributors list.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
