{"id":160671,"date":"2022-08-10T08:28:19","date_gmt":"2022-08-10T08:28:19","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/pdf-invoice-for-woocommerce\/"},"modified":"2026-09-29T02:53:00","modified_gmt":"2026-09-29T02:53:00","slug":"pdf-invoice-for-woocommerce","status":"publish","type":"plugin","link":"https:\/\/nqo.wordpress.org\/plugins\/pdf-invoice-for-woocommerce\/","author":20548111,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.6","stable_tag":"1.6","tested":"7.1.2","requires":"6.5","requires_php":"7.4","requires_plugins":null,"header_name":"PDF Invoice for Woocommerce","header_author":"WpExperts Hub","header_description":"Automatically generate and attach customizable PDF Invoices to WooCommerce order emails.","assets_banners_color":"ced1d8","last_updated":"2026-09-29 02:53:00","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_xclick&business=jodhavishalsingh@gmail.com&item_name=Donation+For+PDF+Invoice+for+Woocommerce","header_plugin_uri":"https:\/\/wpexpertshub.com","header_author_uri":"https:\/\/wpexpertshub.com","rating":5,"author_block_rating":0,"active_installs":20,"downloads":2888,"num_ratings":1,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"jodhavishalsingh","date":"2022-08-10 08:33:04","revision":2768753},"1.1":{"tag":"1.1","author":"jodhavishalsingh","date":"2023-03-25 05:19:22","revision":2886720},"1.2":{"tag":"1.2","author":"jodhavishalsingh","date":"2024-03-14 18:43:57","revision":3051292},"1.3.3":{"tag":"1.3.3","author":"wpexpertshub","date":"2026-03-01 11:27:48","revision":3472038},"1.3.4":{"tag":"1.3.4","author":"wpexpertshub","date":"2026-03-02 06:07:10","revision":3472364},"1.4":{"tag":"1.4","author":"jodhavishalsingh","date":"2026-08-19 13:49:35","revision":3654737},"1.6":{"tag":"1.6","author":"jodhavishalsingh","date":"2026-09-29 02:53:00","revision":3718176}},"upgrade_notice":{"1.6":"<p>Security and reliability release: invoice PDFs are no longer publicly downloadable, customer data is escaped in the PDF, and several fatal errors are fixed. Recommended for all users.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":1},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3472038,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3472038,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3472038,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3472038,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2","1.3.3","1.3.4","1.4","1.6"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3654712,"resolution":"1","location":"assets","locale":"","width":3024,"height":4084},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3654712,"resolution":"2","location":"assets","locale":"","width":3014,"height":1716},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3654712,"resolution":"3","location":"assets","locale":"","width":3024,"height":3180}},"screenshots":{"1":"The \"Download Invoice\" button on the order received page.","2":"Invoice and packing slip buttons in the WooCommerce Orders list.","3":"The settings under WooCommerce &gt; Settings &gt; PDF Invoice."}},"plugin_section":[],"plugin_tags":[51080,57399,195350,62469,148696],"plugin_category":[],"plugin_contributors":[82408,212494],"plugin_business_model":[],"class_list":["post-160671","plugin","type-plugin","status-publish","hentry","plugin_tags-packing-slip","plugin_tags-pdf-invoice","plugin_tags-vat-invoice","plugin_tags-woocommerce-invoice","plugin_tags-woocommerce-pdf-invoice","plugin_contributors-jodhavishalsingh","plugin_contributors-wpexpertshub","plugin_committers-jodhavishalsingh","plugin_committers-wpexpertshub"],"banners":{"banner":"https:\/\/ps.w.org\/pdf-invoice-for-woocommerce\/assets\/banner-772x250.png?rev=3472038","banner_2x":"https:\/\/ps.w.org\/pdf-invoice-for-woocommerce\/assets\/banner-1544x500.png?rev=3472038","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/pdf-invoice-for-woocommerce\/assets\/icon-128x128.png?rev=3472038","icon_2x":"https:\/\/ps.w.org\/pdf-invoice-for-woocommerce\/assets\/icon-256x256.png?rev=3472038","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/pdf-invoice-for-woocommerce\/assets\/screenshot-1.png?rev=3654712","caption":"The \"Download Invoice\" button on the order received page."},{"src":"https:\/\/ps.w.org\/pdf-invoice-for-woocommerce\/assets\/screenshot-2.png?rev=3654712","caption":"Invoice and packing slip buttons in the WooCommerce Orders list."},{"src":"https:\/\/ps.w.org\/pdf-invoice-for-woocommerce\/assets\/screenshot-3.png?rev=3654712","caption":"The settings under WooCommerce &gt; Settings &gt; PDF Invoice."}],"raw_content":"<!--section=description-->\n<p><strong>PDF Invoice for WooCommerce<\/strong> creates a clean, professional PDF invoice for every order and attaches it to the WooCommerce emails you choose. Customers can download their invoice from their account, and you can download invoices and packing slips straight from the Orders screen.<\/p>\n\n<p>Each invoice shows your logo and company details, the customer's billing details and VAT number, every purchased item with its SKU and options, taxes, shipping, the totals and the amount due.<\/p>\n\n<h4>Invoices<\/h4>\n\n<ul>\n<li><strong>Automatic<\/strong> - an invoice is generated when an order reaches the statuses you choose (for example Processing or Completed).<\/li>\n<li><strong>Paid invoices<\/strong> - orders in the statuses you mark as paid show a green PAID badge and an amount due of zero.<\/li>\n<li><strong>Email attachments<\/strong> - attach the invoice to any WooCommerce order email: New order, Processing order, Completed order, Order details and more.<\/li>\n<li><strong>Sequential invoice numbers<\/strong> - optional, with your own starting number. A number is never issued twice, even when many orders change status at the same time.<\/li>\n<li><strong>VAT number<\/strong> - an optional VAT Number field for the classic checkout and the Checkout block, printed on the invoice, the packing slip and the admin order screen.<\/li>\n<li><strong>Complete order details<\/strong> - item SKUs, variation attributes and add-ons, taxes, shipping, payment method and totals, with \"Page X of Y\" on every page.<\/li>\n<li><strong>Your branding<\/strong> - logo (PNG, JPG or SVG), company name, address, email, phone, a footer note and copyright text.<\/li>\n<li><strong>Any language<\/strong> - non-Latin text (for example Cyrillic and Greek) and currency symbols print correctly with the bundled DejaVu Sans font.<\/li>\n<\/ul>\n\n<h4>Packing slips<\/h4>\n\n<ul>\n<li>Printable packing slips with the items, quantities and options, the billing and shipping address, the shipping method and the payment method - no prices.<\/li>\n<li>The packing slip button in the Orders list can be switched off in the settings.<\/li>\n<\/ul>\n\n<h4>For customers<\/h4>\n\n<ul>\n<li>\"Download Invoice\" button on the order received and view order pages, and an \"Invoice\" action in My Account &gt; Orders.<\/li>\n<li>Guests can download their invoice with the secure order link.<\/li>\n<li>Invoices are only offered for orders that reached an invoice status, so no invoice is created for pending, failed or cancelled orders.<\/li>\n<\/ul>\n\n<h4>For store owners<\/h4>\n\n<ul>\n<li>Download invoices and packing slips from the WooCommerce Orders list.<\/li>\n<li>\"Preview Template\" in the settings shows a sample invoice with your company details.<\/li>\n<li>Override the invoice and packing slip templates in your theme (<code>yourtheme\/invoice-for-wc\/template-1.php<\/code> and <code>packing-slip.php<\/code>).<\/li>\n<\/ul>\n\n<h4>Compatibility<\/h4>\n\n<ul>\n<li>High-Performance Order Storage (HPOS) and the Cart and Checkout blocks.<\/li>\n<li>Translation ready.<\/li>\n<\/ul>\n\n<h4>Privacy and security<\/h4>\n\n<ul>\n<li>Generated PDFs are stored with an unguessable file name in a protected folder (<code>uploads\/wphub-invoice<\/code>) and are only delivered through permission-checked download links.<\/li>\n<li>PDFs are a cache: files older than 7 days are removed automatically and re-created from the current order when needed.<\/li>\n<li>Customer data is escaped before it goes into the PDF, and scripts in documents are disabled.<\/li>\n<li>No tracking and no external services - PDFs are created on your own server with the bundled Dompdf library.<\/li>\n<\/ul>\n\n<h4>For developers<\/h4>\n\n<p>Filters: <code>wphub_invoice_placeholders<\/code>, <code>wphub_invoice_number<\/code>, <code>wphub_invoice_paper_size<\/code>, <code>wphub_invoice_date_format<\/code>, <code>wphub_invoice_page_number_text<\/code>, <code>wphub_invoice_customer_can_download<\/code>, <code>wphub_invoice_dompdf_options<\/code>, <code>wphub_invoice_cleanup_days<\/code> and <code>wphub_invoice_settings<\/code>. Actions: <code>wphub_before_pdf_invoice<\/code> and <code>wphub_after_pdf_invoice<\/code>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Go to Plugins &gt; Add New Plugin, search for \"PDF Invoice for Woocommerce\" (or upload the zip), then install and activate it. WooCommerce must be active.<\/li>\n<li>Go to WooCommerce &gt; Settings &gt; PDF Invoice, enter your company details and choose when invoices are generated, marked as paid and attached to emails.<\/li>\n<li>Click \"Preview Template\" to check the layout.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"when%20is%20an%20invoice%20created%3F\"><h3>When is an invoice created?<\/h3><\/dt>\n<dd><p>When an order reaches one of the statuses selected under \"Generate Invoice\" (Processing by default), and whenever the invoice is attached to an email or downloaded. It always reflects the current order.<\/p><\/dd>\n<dt id=\"which%20emails%20can%20include%20the%20invoice%3F\"><h3>Which emails can include the invoice?<\/h3><\/dt>\n<dd><p>Any WooCommerce email that belongs to an order. Choose them under \"Attach to Emails\" (New order, Processing order, Completed order and Order details are selected by default).<\/p><\/dd>\n<dt id=\"how%20do%20sequential%20invoice%20numbers%20work%3F\"><h3>How do sequential invoice numbers work?<\/h3><\/dt>\n<dd><p>Enable \"Sequential Invoice Numbers\" and set the starting number. The first invoice gets exactly that number and each new invoice the next one. Raising the starting number later continues from the new number; lowering it never re-uses a number. When the option is off, the WooCommerce order ID is used.<\/p><\/dd>\n<dt id=\"how%20do%20i%20add%20my%20logo%3F\"><h3>How do I add my logo?<\/h3><\/dt>\n<dd><p>Upload it under Media &gt; Library, copy its file URL and paste it into \"Company Logo\". PNG, JPG and SVG work; the image is embedded in the PDF.<\/p><\/dd>\n<dt id=\"can%20customers%20download%20their%20invoices%3F\"><h3>Can customers download their invoices?<\/h3><\/dt>\n<dd><p>Yes, from the order received page, the view order page and the My Account &gt; Orders list, once the order has reached an invoice status. Guests use the secure link of their order.<\/p><\/dd>\n<dt id=\"can%20i%20change%20the%20invoice%20layout%3F\"><h3>Can I change the invoice layout?<\/h3><\/dt>\n<dd><p>Yes. Copy <code>templates\/template-1.php<\/code> or <code>templates\/packing-slip.php<\/code> from the plugin to <code>yourtheme\/invoice-for-wc\/<\/code> and edit the copy. Available placeholders include <code>{invoice_number}<\/code>, <code>{invoice_date}<\/code>, <code>{invoice_status}<\/code>, <code>{amount_due}<\/code>, <code>{billing_address}<\/code>, <code>{billing_address_only}<\/code>, <code>{billing_vat_number}<\/code>, <code>{shipping_address}<\/code>, <code>{your_company_name}<\/code> and <code>{current_year}<\/code>.<\/p><\/dd>\n<dt id=\"can%20i%20use%20us%20letter%20paper%3F\"><h3>Can I use US Letter paper?<\/h3><\/dt>\n<dd><p>Yes, with the <code>wphub_invoice_paper_size<\/code> filter, for example <code>add_filter( 'wphub_invoice_paper_size', function () { return 'letter'; } );<\/code>.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20the%20checkout%20block%3F\"><h3>Does it work with the Checkout block?<\/h3><\/dt>\n<dd><p>Yes. The VAT Number field is added to the Checkout block's Contact information step and to the classic checkout.<\/p><\/dd>\n<dt id=\"where%20are%20the%20pdf%20files%20stored%3F\"><h3>Where are the PDF files stored?<\/h3><\/dt>\n<dd><p>In <code>wp-content\/uploads\/wphub-invoice\/<\/code>, with unguessable file names. They are removed automatically after 7 days and re-created when needed, so deleting them is safe.<\/p><\/dd>\n<dt id=\"where%20can%20i%20get%20help%3F\"><h3>Where can I get help?<\/h3><\/dt>\n<dd><p>Please open a topic in the <a href=\"https:\/\/wordpress.org\/support\/plugin\/pdf-invoice-for-woocommerce\/\">support forum<\/a>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.6 - 2026-09-29<\/h4>\n\n<ul>\n<li>Fix - Checkout, order emails and other front-end requests could stop with a fatal error (\"Call to undefined function wp_tempnam()\") the first time a remote company logo was downloaded.<\/li>\n<li>Fix - The customer's name and company were printed twice on invoices and packing slips (once on their own and again inside the formatted address).<\/li>\n<li>Fix - Packing slips showed an empty \"Ship to\" block and \"Shipping Method\" row for orders without a shipping address or shipping method.<\/li>\n<li>Feature - Invoices now list item details (variation attributes, product add-ons and other item meta) under each line, like the packing slip.<\/li>\n<li>Dev - New template placeholders {billing_address_only} and {shipping_address_only} (the formatted address without the name and company lines).<\/li>\n<li>Tweak - Updated the bundled libraries: masterminds\/html5 2.11.0 and sabberworm\/php-css-parser 9.5.0. Dompdf 3.1.6, php-font-lib 1.0.2 and php-svg-lib 1.0.2 are the latest releases.<\/li>\n<li>Fix - Sequential numbering: the first invoice got the starting number + 1 instead of the configured starting number. Raising the starting number later now takes effect; lowering it never re-issues a used number.<\/li>\n<li>Security - Generated PDFs were stored as uploads\/wphub-invoice\/invoice-{number}.pdf, i.e. publicly downloadable by guessing the number. Files now carry an unguessable site-specific hash, the folder is protected (index.php + .htaccess) and old files are removed on update. PDFs are always delivered through the permission-checked download links.<\/li>\n<li>Security - Customer checkout data (company, name, phone, email, VAT number) was inserted into the PDF HTML unescaped, allowing markup (e.g. remote images) to be injected into the PDF renderer. All values are now escaped.<\/li>\n<li>Feature - VAT Number field now also works with the WooCommerce Checkout block (Checkout Fields API); the value appears on the invoice, packing slip and the admin order screen.<\/li>\n<li>Feature - \"Invoice\" download action in My Account &gt; Orders.<\/li>\n<li>Fix - Customers could download an \"invoice\" for pending, failed or cancelled orders (and use up sequential numbers). Customer downloads are now limited to orders in a \"Generate Invoice\" \/ \"Mark as Paid\" status or that already have an invoice.<\/li>\n<li>Fix - Emails and downloads could deliver an outdated invoice (e.g. without the PAID label, or before an order edit) for up to 7 days; the PDF is now re-rendered for the current order when attached or downloaded.<\/li>\n<li>Fix - Fatal error when the email attachments filter ran for an email without an order (e.g. account emails) or was applied with three arguments.<\/li>\n<li>Fix - \"Page X of Y\" was never printed (embedded PHP is disabled in Dompdf); page numbers are now drawn natively on invoices and packing slips.<\/li>\n<li>Fix - Bold text in the templates fell back to a serif font; Cyrillic, Greek and other non-Latin customer names printed as \"?\" (DejaVu Sans fallback added).<\/li>\n<li>Fix - Fatal error on invoices containing a deleted product or a zero-quantity line.<\/li>\n<li>Fix - PHP warnings on fresh installs before the settings were saved; clearing all \"Generate Invoice\", \"Mark as Paid\" or \"Attach to Emails\" choices silently restored the defaults.<\/li>\n<li>Fix - Plugin did not load on multisite when WooCommerce was activated per site instead of network-wide.<\/li>\n<li>Fix - The settings screen also wrote a redundant autoloaded \"wphub-invoice\" option (removed on update).<\/li>\n<li>Fix - Advance Partial Shipment documents were streamed with an invalid file name; {shipping_phone} placeholder added.<\/li>\n<li>Tweak - Settings are sanitized per type (URL, email, number); the company logo is cached instead of being downloaded for every PDF.<\/li>\n<li>Tweak - Removed unused Dompdf files and the DejaVu Sans Mono \/ DejaVu Serif fonts (plugin size 11 MB to 7 MB). Bundled Dompdf is 3.1.6 (latest; includes the 2026 security fixes).<\/li>\n<li>Tweak - Tested with WordPress 7.1 and WooCommerce 11.1 (HPOS and Checkout block) on PHP 8.2 - 8.5. Minimum PHP lowered to 7.4 (the code and the bundled libraries support it).<\/li>\n<li>Dev - New filters: wphub_invoice_dompdf_options, wphub_invoice_placeholders, wphub_invoice_number, wphub_invoice_customer_can_download, wphub_invoice_page_number_text, wphub_invoice_paper_size, wphub_invoice_date_format, wphub_invoice_cleanup_days.<\/li>\n<\/ul>\n\n<h4>1.5 - 2026-09-16<\/h4>\n\n<ul>\n<li>Fix - Placeholder replacement in invoice\/packing-slip templates used order and customer data (billing address, company name, VAT number, etc.) as a preg_replace() replacement string; a value containing \"$1\" or similar could be interpreted as a regex backreference and silently corrupt the generated PDF. Switched to a plain, safe string replacement.<\/li>\n<li>Fix - Sequential invoice numbering read-then-wrote the \"last invoice number\" option non-atomically, so two orders changing status at nearly the same time (e.g. a bulk status update) could be assigned the same invoice number. The increment is now atomic.<\/li>\n<li>Fix - The admin-only invoice preview AJAX endpoint accepted a \"template\" value that was used to build a filesystem path without validation, and had no capability check beyond the nonce. Added a capability check and restricted the value to known template files.<\/li>\n<li>Fix - The CSS\/JS cache-busting version constant was stuck at an older value than the plugin version across the last two releases, so updated assets could be served from a stale browser cache. It now matches the plugin version.<\/li>\n<li>Tweak - Removed a leftover unused debug variable from the invoice preview script.<\/li>\n<\/ul>\n\n<h4>1.4 - 19\/08\/2026<\/h4>\n\n<ul>\n<li>Tweak - Text domain renamed to \"pdf-invoice-for-woocommerce\" to match the plugin slug and improve translation loading reliability.<\/li>\n<li>Tweak - Improved escaping, security, and WordPress coding standards for better Plugin Check compliance.<\/li>\n<li>Feature - Added daily background cleanup to automatically delete generated PDF invoices and packing slips older than 7 days from the uploads directory.<\/li>\n<li>Feature - Added Download Invoice and Download Packing Slip icons to the WooCommerce Orders list action column.<\/li>\n<li>Feature - Added a Download Invoice button to the front-end order details page for customers.<\/li>\n<li>Feature - Added Packing Slip PDF generation.<\/li>\n<\/ul>\n\n<h4>1.3 - 01\/03\/2026<\/h4>\n\n<ul>\n<li>Fix - Packing slip PDF preview fix. <\/li>\n<\/ul>\n\n<h4>1.2 - 14\/03\/2024<\/h4>\n\n<ul>\n<li>Fix - HPOS Compatibility.<\/li>\n<\/ul>\n\n<h4>1.1 - 25\/03\/2023<\/h4>\n\n<ul>\n<li>Fix - Packing Slip added for advanced partial shipment plugin.<\/li>\n<\/ul>\n\n<h4>1.0 - 10\/11\/2022<\/h4>\n\n<ul>\n<li>Initial Release.<\/li>\n<\/ul>","raw_excerpt":"Automatically generate professional PDF invoices and packing slips for WooCommerce orders and attach them to order emails.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/160671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=160671"}],"author":[{"embeddable":true,"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/wpexpertshub"}],"wp:attachment":[{"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=160671"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=160671"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=160671"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=160671"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=160671"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/nqo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=160671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}