=== TextToPdfNet – Text & Web to PDF Converter ===
Contributors: texttopdfnet
Tags: pdf, converter, text to pdf, post to pdf, export pdf
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Convert text and single website content into clean PDF files effortlessly.

== Description ==

TextToPdfNet is a lightweight, secure WordPress plugin that lets your visitors convert text and web content into clean PDF documents. Whether you need a simple [text to PDF converter](https://texttopdf.net/) form or a one-click download button for your posts and pages, this plugin handles it all — right on your own server, with zero external API calls.

### Key Features:

1. **Frontend Text-to-PDF Converter**: Add a simple form anywhere on your site using the `[text_to_pdf_form]` shortcode. Visitors can paste any text and instantly download it as a formatted PDF.
2. **Post/Page-to-PDF Converter**: Automatically append a "Download PDF" button to your posts or pages, or place it manually using the `[text_to_pdf_button]` shortcode. The generated PDF delivers a clean reading experience — no sidebars, popups, or comment sections.
3. **Watermark & Branding**: Add your site name and logo as a watermark on every PDF page. Control the size, position, and opacity from the admin settings.
4. **Download Tracking**: View how many times each post has been downloaded as a PDF directly from the WordPress admin post list.
5. **Fully Customizable Output**: Configure page sizes (A4, Letter), font sizes, margin presets, custom headers/footers, and choose whether to include the featured image, author name, publish date, or post title.

### Privacy & Security

This plugin prioritizes your data safety. It uses a locally bundled copy of [Dompdf](https://github.com/dompdf/dompdf) to generate PDFs entirely on your server. No content is ever sent to external APIs or third-party services. For more details, see our [privacy policy](https://texttopdf.net/privacy-policy).

### Support & Feedback

Need help or have a feature request? Visit our [contact page](https://texttopdf.net/contact-us) or use the WordPress.org support forum.

For documentation and online tools, visit [TextToPDF.net](https://texttopdf.net/).

== Installation ==

1. Upload the `texttopdfnet-text-web-to-pdf` folder to the `/wp-content/plugins/` directory, or install the ZIP directly via **Plugins > Add New > Upload Plugin** in your WordPress admin.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Navigate to **Settings > Text to PDF** to configure your preferences.

== Usage Guide ==

This plugin provides two shortcodes and an automatic button feature. Here is how to use each one:

= Shortcode: Text-to-PDF Form =

Use the shortcode below to add a [text to PDF converter](https://texttopdf.net/) form on any page or post. Visitors can type or paste any text, give it a title, and download it instantly as a PDF.

`[text_to_pdf_form]`

**How to add it:**

1. Edit any page or post in WordPress.
2. Add a **Shortcode** block (or paste directly into the Classic Editor).
3. Type `[text_to_pdf_form]` and publish/update the page.
4. Visitors will see a form with a title field, a text area, and a "Generate PDF" button.

= Shortcode: Download Button for Current Post =

Use this shortcode to manually place a "Download as PDF" button anywhere inside a post or page. When clicked, the current post/page content is converted to a clean PDF — acting as a [web to PDF converter](https://texttopdf.net/) built right into your site.

`[text_to_pdf_button]`

**How to add it:**

1. Edit the post or page where you want the button.
2. Add a **Shortcode** block.
3. Type `[text_to_pdf_button]` and publish/update.

= Automatic Download Button =

You can also have the plugin automatically add a "Download as PDF" button to all posts and/or pages without using a shortcode. Configure this in **Settings > Text to PDF**:

1. Go to **Settings > Text to PDF**.
2. Check **Enable on Posts** and/or **Enable on Pages**.
3. Choose the **Button Position**: Top of Content, Bottom of Content, Both, or Shortcode Only.
4. Customize the **Button Label** text (default: "Download as PDF").

== Settings Guide ==

Navigate to **Settings > Text to PDF** in your WordPress admin to configure the following:

= Display Options =
* **Enable on Posts** – Automatically show the download button on all posts.
* **Enable on Pages** – Automatically show the download button on all pages.
* **Button Label** – Customize the text shown on the button (e.g., "Download as PDF", "Save PDF", "Export").
* **Button Position** – Choose where the button appears: Top, Bottom, Both Top and Bottom, or Shortcode Only.

= PDF Content Options =
* **Content to Include** – Toggle which elements appear in the generated PDF: Post Title, Featured Image, Author Name, Publish Date.
* **File Name Pattern** – Customize the downloaded file name using `{title}` and `{date}` placeholders. Example: `{title}-{date}` produces `my-blog-post-2026-05-05.pdf`.
* **Global Header Text** – Add custom text to the top of every generated PDF.
* **Global Footer Text** – Add custom text to the bottom of every generated PDF.

= PDF Layout Options =
* **Document Page Size** – Choose between A4 or Letter size.
* **Font Size** – Select Small, Medium, or Large.
* **Margin Preset** – Choose Narrow, Normal, or Wide margins.

= Watermark / Branding Options =
* **Watermark Site Name** – Enter your site name to display as a text watermark on every PDF page.
* **Watermark Logo URL** – Upload or select a logo image from the WordPress Media Library by clicking "Upload / Select Image".
* **Watermark Logo Size (px)** – Set the width of the logo in pixels (default: 500).
* **Watermark Opacity (%)** – Control the transparency of the watermark from 1% (barely visible) to 100% (fully opaque). Default is 30%.
* **Watermark Position** – Choose where the watermark appears: Top Left Corner, Top Right Corner, Center, Bottom Left Corner, or Bottom Right Corner.

== Frequently Asked Questions ==

= How do I add a Text-to-PDF form to my site? =
Add the shortcode `[text_to_pdf_form]` to any page or post. A form will appear where visitors can type text and download it as a PDF. You can also try our online [text to PDF converter](https://texttopdf.net/) at TextToPDF.net.

= How do I add a download button to a specific post? =
Add the shortcode `[text_to_pdf_button]` inside that post or page. Alternatively, enable the automatic button in **Settings > Text to PDF** and it will appear on all posts/pages.

= Does it send data to an external API? =
No. The plugin generates PDFs entirely on your server using the Dompdf library. No data is sent externally. See our [privacy policy](https://texttopdf.net/privacy-policy) for full details.

= Can I add my site logo to the PDF? =
Yes. Go to **Settings > Text to PDF**, scroll to the Watermark section, and upload your logo. You can configure the size, position, and transparency.

= Can I use it on custom post types? =
Currently it officially supports standard Posts and Pages. The `[text_to_pdf_button]` shortcode may also work on other singular content types.

= How do I track PDF downloads? =
The plugin automatically tracks download counts per post. You can view them in the **PDF Downloads** column on the Posts and Pages admin list screens.

= Where can I get support? =
Visit our [contact page](https://texttopdf.net/contact-us) or post in the WordPress.org support forum.

== Screenshots ==

1. Plugin settings menu — "Text to PDF" appears under Settings in the WordPress admin sidebar.
2. Admin settings page (top) — configure display options, button label, position, and content to include.
3. Admin settings page (bottom) — configure file name pattern, header/footer text, page size, font size, margins, and watermark.
4. "Download PDF" button on a post — visitors can download any post as a clean PDF with one click.
5. Frontend post view — the [web to PDF converter](https://texttopdf.net/) button integrates seamlessly with your theme.

== Changelog ==

= 1.0.0 =
* Initial release.
* Frontend text-to-PDF converter form via shortcode.
* Post/page content to PDF download button.
* Admin settings for PDF layout, content, headers, footers.
* Watermark support with configurable logo, text, position, size, and opacity.
* Per-post download tracking with admin column display.
