=== Advanced PDF Invoice Builder ===
Contributors: natsenack
Tags: invoice, pdf, woocommerce, generator, template
Requires at least: 6.9
Tested up to: 7.0
Requires PHP: 8.2
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
WC requires at least: 9.9
WC tested up to: 10.0

💼 Professional PDF invoice and document builder for WordPress — visual drag-and-drop editor with WooCommerce integration.

== Description ==

Advanced PDF Invoice Builder lets you **create, customize, and generate PDF invoices or documents** directly from your WordPress admin area. Build your own templates with a **live drag-and-drop canvas** and attach them to WooCommerce orders automatically.

**Perfect for:**
* E-commerce stores needing branded PDF invoices
* Service businesses generating quotes and documents
* Anyone who needs professional-looking PDFs without coding

---

== 🎁 Free Features (BASE EDITION) ==

**Canvas Editor**
* Visual drag-and-drop PDF template editor (React 18, real-time preview)
* Drag-and-drop elements — text, image, line, rectangle
* Full element control — position, size, rotation, colors, fonts

**PDF Generation**
* High-performance Puppeteer-based rendering engine
* Automatic WooCommerce integration — auto-generate PDFs by order status, email to customer

**Document Templates**
* **2 document types:** Invoice & Quote
* **3 dynamic text models** for common fields
* **3 mention templates** (terms, legal notices, etc.)

**Export Options**
* **3 DPI settings:** 72, 96, 150 DPI
* **Format:** PDF only
* **Page size:** A4 portrait only

**Localization**
* **French (fr_FR) & English** translations included
* RTL support (`/languages`)
* Full source code included (TypeScript + PHP, GPL v2)

**Limits**
* Up to **1 custom template** saved in database

---

== 🚀 Pro Edition (PREMIUM ADD-ON) ==

*Available separately at [hub.threeaxe.fr](https://hub.threeaxe.fr)*

**Everything in FREE, PLUS:**

**Extended Document Types**
* **6 document types:** Invoice, Quote, Purchase Order, Credit Note, Delivery Note, Contract
* **36 advanced dynamic text models** (vs 3 in FREE)
* **21 advanced mention templates** (vs 3 in FREE)

**Advanced Export**
* **PNG & JPG image export** in addition to PDF
* **6 DPI settings:** 72, 96, 150, 300, 600 DPI
* **4 page formats + landscape:** A3, Letter, Legal, A4 + all in landscape
* Transparent background export

**Canvas Features**
* Grid navigation & snapping
* Guides and alignment tools
* Multi-select elements
* Keyboard shortcuts
* Theme customization
* Layer ordering & manipulation
* Full element locking system

**Template Management**
* **Unlimited custom templates** (vs 1 in FREE)
* **Gallery of 3 premium pre-designed templates**
* Set default template per document type

**Support**
* Priority support & updates

---

== Installation ==

1. Download and unzip the plugin to the `/wp-content/plugins/` directory.
2. Activate the plugin through the "Plugins" menu in WordPress.
3. Go to **"PDF Builder"** in the main admin menu to configure your settings.
4. Create your first template and customize it!

== Getting Started ==

1. Navigate to **PDF Builder → Templates** in your WordPress admin
2. Click **"Create New Template"**
3. Use the drag-and-drop editor to design your template
4. Save and test with a sample WooCommerce order
5. Enable auto-generation in settings

== Source Code ==

This plugin contains minified/compiled JavaScript and CSS files. The complete unminified source code is included in the plugin package, as required by WordPress.org guidelines.

**Source Repository:**
* **GitHub:** https://github.com/natsenack/advanced-pdf-invoice-builder
* **Build tool:** webpack 5
* **Build command:** `npm install && npm run build:free`

**Compiled assets mapped to sources:**

* `assets/js/pdf-builder-react.min.js` ← `src/js/react/` (TypeScript/JSX)
* `assets/js/vendors.min.js` ← webpack vendor bundle (React, ReactDOM, etc.)
* `assets/js/notifications.min.js` ← `src/js/admin/notifications.js`
* `assets/js/settings-tabs.min.js` ← `src/js/admin/settings-tabs.js`
* `assets/js/canvas-settings.min.js` ← `src/js/admin/canvas-settings.js`
* `assets/css/pdf-builder-react.min.css` ← `src/css/pdf-builder-react.css`
* `assets/css/pdf-builder-admin-css.min.css` ← `src/css/pdf-builder-admin.css`

**Third-party Library:**
* `assets/js/html2canvas.min.js` — [html2canvas v1.4.1](https://github.com/niklasvh/html2canvas) (MIT License)

---

== Privacy & Data ==

✅ **This plugin is privacy-first:**

**Deactivation Feedback (Optional)**
* Collected **only** when you click "Send and Deactivate"
* Anonymous — includes reason, optional comment, site URL, version, date/time
* No passwords, no personal data, no tracking without consent
* You can always skip the modal or use "Skip and Deactivate"

---

== Frequently Asked Questions ==

= Which WordPress versions are supported? =

Advanced PDF Invoice Builder requires **WordPress 6.9 or later**.

= Is this compatible with WooCommerce? =

**Yes!** The plugin provides native WooCommerce integration for automatic order PDF generation. Requires **WooCommerce 9.9+**.

= What PDF formats are supported? =

The plugin generates standard PDF files compatible with all modern PDF readers (Adobe Reader, Preview, Chrome, Firefox, Edge, etc.).

= Can I use custom fonts? =

Yes! The plugin uses local/system font stacks for reliable rendering. No Google Fonts or external dependencies.

= How does PDF generation work? =

Templates are rendered server-side using Puppeteer on our secure PDF service (pdf.threeaxe.fr). All communication is HTTPS.

= What about the Pro edition? =

The **Pro edition** is sold separately and adds 6 document types, advanced canvas features, unlimited templates, and image export. Learn more at [hub.threeaxe.fr](https://hub.threeaxe.fr).

---

== External Services ==

This plugin connects to third-party services for PDF generation and license validation. **All are optional and require explicit configuration.**

**By using this plugin, you agree to their terms of service and privacy policies.**

= 📄 PDF Generation Service (pdf.threeaxe.fr) =
* **Purpose:** Renders templates to PDF/PNG/JPG
* **When used:** When you generate a PDF from WooCommerce or the admin editor
* **Data sent:** Template HTML, fonts, colors, order data (if from WooCommerce)
* **Service URL:** https://pdf.threeaxe.fr
* **Privacy:** https://hub.threeaxe.fr/privacy-policy/
* **Terms:** https://hub.threeaxe.fr/conditions-dutilisation

= 🔑 License Validation Server (hub.threeaxe.fr) =
* **Purpose:** Activate, deactivate, and verify Pro licenses
* **When used:** (1) When you manually manage license keys; (2) Once daily on admin pages (Pro only)
* **Data sent:** License key, site URL, plugin name
* **Service URL:** https://hub.threeaxe.fr
* **Privacy:** https://hub.threeaxe.fr/privacy-policy/
* **Terms:** https://hub.threeaxe.fr/conditions-dutilisation

= 📦 WordPress.org Updates (api.wordpress.org) =
* **Purpose:** Check for plugin updates
* **When used:** Automatically via WordPress update system
* **Data sent:** None (standard WordPress mechanism)
* **Service URL:** https://api.wordpress.org

= ☁️ Optional Cloud Integrations (opt-in) =

The following are **completely optional and disabled by default:**

* **Google Drive** — Export PDFs to Google Drive
* **Dropbox** — Export PDFs to Dropbox
* **Microsoft OneDrive** — Export PDFs to OneDrive
* **Slack** — Send PDF notifications to Slack
* **HubSpot** — Attach PDFs to CRM contacts
* **Salesforce** — Attach PDFs to Salesforce records

*None of these require configuration unless you explicitly enable them. No data leaves your site without your consent.*

---

== Author Links ==

This plugin includes navigational links to author-owned pages:

* **Product & Upgrade:** https://hub.threeaxe.fr
* **Support Tickets:** https://hub.threeaxe.fr/index.php/ticket/
* **GitHub Repository:** https://github.com/natsenack/advanced-pdf-invoice-builder

*These links are purely informational and do not automatically send site data.*

---

== Changelog ==

= 1.0.3 =
* **Fix:** Grid snap system — corrected state path for proper drag snapping
* **Fix:** Context menu layer ordering — bring-to-front, send-to-back now work correctly
* **Fix:** Locked/unlocked element state — toggle now persists and marks template as modified
* **Fix:** FREE edition template limit (1 template) — creation flow no longer continues after insert
* **Security:** Verify user ownership before template updates
* **Improvement:** Block editor access in "new" mode when template limit reached
* **Code quality:** PHPCS fixes for WordPress.org compliance (comments, indentation, whitespace)

= 1.0.2 =
* **Fix:** Translation system (i18n) repaired — corrupted files cleaned up
* **Improvement:** Language folder reorganized with regenerated POT template (738 strings)
* **Improvement:** 26 French translations now available (fr_FR locale)
* **New:** Translation status documentation included

= 1.0.0 =
* Initial public release — plugin split into FREE and PRO editions
* Plugin submitted to WordPress.org

---

== Support ==

📧 **Need help?**

* Visit our [support portal](https://hub.threeaxe.fr/index.php/ticket/)
* Check the [GitHub documentation](https://github.com/natsenack/advanced-pdf-invoice-builder)
* Report bugs on GitHub Issues

🚀 **Want to upgrade?**

Visit [hub.threeaxe.fr](https://hub.threeaxe.fr) to learn about the Pro edition and premium features.

---

**Made with ❤️ by Threeaxe**
