@prefix sioc: <http://rdfs.org/sioc/ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix content: <http://purl.org/rss/1.0/modules/content/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<https://lhero.org/?p=1506>
  a sioc:Post ;
  dc:title "LH Woocommerce PDF Invoicing" ;
  dcterms:identifier 1506 ;
  dc:modified "2026-09-01T16:37:36Z"^^xsd:dateTime ;
  dc:created "2018-09-18T15:00:14Z"^^xsd:dateTime ;
  sioc:link <https://lhero.org/portfolio/lh-woocommerce-invoicing/> ;
  sioc:has_creator <https://lhero.org/author/1/#account> ;
  sioc:has_container <https://lhero.org/#posts> ;
  content:encoded """
<p class="wp-block-paragraph">LH Woocommerce PDF Invoicing dynamically generates a PDF invoice for every WooCommerce order, served via a REST API endpoint. Nothing is written to disk or cached &#8212; the PDF is generated fresh on every request, using <a href="https://github.com/dompdf/dompdf">DOMPDF</a> (vendored via Composer). The invoice number is simply the WooCommerce order number, so no separate invoice sequence or database table is needed.</p>



<h2 class="wp-block-heading">Key features</h2>



<ul class="wp-block-list">
<li>REST endpoint (<code>GET /wp-json/lh-woocommerce-pdf-invoicing/v1/invoice/{order_id}</code>) that streams a binary PDF, with permission checks so admins can fetch any order and customers only their own.</li>
<li>&#8220;Download PDF Invoice&#8221; button in the order edit screen metabox and the WooCommerce order actions dropdown.</li>
<li>&#8220;Download Invoice&#8221; button on the customer&#8217;s My Account &#8594; Orders screen.</li>
<li>PAID (green) / AMOUNT DUE (amber) banner on the invoice, driven by <code>$order-&gt;is_paid()</code> so it works across <code>processing</code>, <code>completed</code>, and custom paid statuses.</li>
<li>Site logo, company/registration number, VAT/ABN number, BACS bank details (auto-populated from WooCommerce settings on unpaid orders), and a disclaimer block &#8212; all optional and filter-driven.</li>
<li>No database tables and no cron jobs &#8212; everything is derived from the order at render time.</li>
</ul>



<h2 class="wp-block-heading">Requirements</h2>



<ul class="wp-block-list">
<li>WordPress 6.0+</li>
<li>PHP 8.0+</li>
<li>WooCommerce (any recent version)</li>
<li>Composer, for the initial vendor install</li>
</ul>



<h2 class="wp-block-heading">Install</h2>



<ol class="wp-block-list">
<li>Upload the <code>lh-woocommerce-pdf-invoicing</code> folder to <code>wp-content/plugins/</code>.</li>
<li>In the plugin directory, run <code>composer install --no-dev --optimize-autoloader</code> to install DOMPDF and its dependencies into <code>vendor/</code>.</li>
<li>Activate the plugin.</li>
</ol>



<h2 class="wp-block-heading">Bundled libraries</h2>



<p class="wp-block-paragraph">DOMPDF v2.x (LGPL-2.1), plus DOMPDF&#8217;s own dependencies vendored alongside it &#8212; <code>phenx/php-font-lib</code>, <code>phenx/php-svg-lib</code>, <code>masterminds/html5</code>, and <code>sabberworm/php-css-parser</code>. Since these are vendored copies rather than a shared Composer install, PHP-version deprecation fixes to them sometimes need to be patched directly in this plugin rather than waiting on a WooCommerce/DOMPDF update &#8212; see the Changelog.</p>



<h2 class="wp-block-heading">Contents</h2>



<ul class="wp-block-list">
<li><a href="https://lhero.org/portfolio/lh-woocommerce-invoicing/rest-api-admin-interface/">REST API &amp; Admin Interface</a> &#8212; endpoint, permissions, and where the download buttons appear</li>
<li><a href="https://lhero.org/portfolio/lh-woocommerce-invoicing/filters-reference/">Filters Reference</a> &#8212; every filter this plugin exposes, with examples</li>
<li><a href="https://lhero.org/portfolio/lh-woocommerce-invoicing/changelog/">Changelog</a> &#8212; full version history</li>
</ul>
"""^^rdf:XMLLiteral ;
  sioc:content """
LH Woocommerce PDF Invoicing dynamically generates a PDF invoice for every WooCommerce order, served via a REST API endpoint. Nothing is written to disk or cached &#8212; the PDF is generated fresh on every request, using DOMPDF (vendored via Composer). The invoice number is simply the WooCommerce order number, so no separate invoice sequence or database table is needed.



Key features




REST endpoint (GET /wp-json/lh-woocommerce-pdf-invoicing/v1/invoice/{order_id}) that streams a binary PDF, with permission checks so admins can fetch any order and customers only their own.
&#8220;Download PDF Invoice&#8221; button in the order edit screen metabox and the WooCommerce order actions dropdown.
&#8220;Download Invoice&#8221; button on the customer&#8217;s My Account &#8594; Orders screen.
PAID (green) / AMOUNT DUE (amber) banner on the invoice, driven by $order-&gt;is_paid() so it works across processing, completed, and custom paid statuses.
Site logo, company/registration number, VAT/ABN number, BACS bank details (auto-populated from WooCommerce settings on unpaid orders), and a disclaimer block &#8212; all optional and filter-driven.
No database tables and no cron jobs &#8212; everything is derived from the order at render time.




Requirements




WordPress 6.0+
PHP 8.0+
WooCommerce (any recent version)
Composer, for the initial vendor install




Install




Upload the lh-woocommerce-pdf-invoicing folder to wp-content/plugins/.
In the plugin directory, run composer install --no-dev --optimize-autoloader to install DOMPDF and its dependencies into vendor/.
Activate the plugin.




Bundled libraries



DOMPDF v2.x (LGPL-2.1), plus DOMPDF&#8217;s own dependencies vendored alongside it &#8212; phenx/php-font-lib, phenx/php-svg-lib, masterminds/html5, and sabberworm/php-css-parser. Since these are vendored copies rather than a shared Composer install, PHP-version deprecation fixes to them sometimes need to be patched directly in this plugin rather than waiting on a WooCommerce/DOMPDF update &#8212; see the Changelog.



Contents




REST API &amp; Admin Interface &#8212; endpoint, permissions, and where the download buttons appear
Filters Reference &#8212; every filter this plugin exposes, with examples
Changelog &#8212; full version history

""" ;
  sioc:topic <https://lhero.org/lh_portfolio-type/plugin/>, <https://lhero.org/lh_portfolio-lifecycle-stage/active/>, <https://lhero.org/?taxonomy=author&term=cap-1> .

<https://lhero.org/author/1/#account> rdfs:seeAlso <https://lhero.org/author/1/?feed=lhrdf&format=turtle> .
<https://lhero.org/lh_portfolio-type/plugin/> rdfs:seeAlso <https://lhero.org/lh_portfolio-type/plugin/?feed=lhrdf&format=turtle> .
<https://lhero.org/lh_portfolio-lifecycle-stage/active/> rdfs:seeAlso <https://lhero.org/lh_portfolio-lifecycle-stage/active/?feed=lhrdf&format=turtle> .
<https://lhero.org/?taxonomy=author&term=cap-1> rdfs:seeAlso <https://lhero.org/?taxonomy=author&term=cap-1&feed=lhrdf&format=turtle> .
