Most WooCommerce stores eventually need proper order documents.
You might need a PDF invoice for accounting, a receipt for the customer, a packing slip for fulfilment, or a credit note when a refund is issued. You also want documents that look professional, match your branding, and work reliably across WooCommerce email flows.
Kitgenix PDF Invoicing for WooCommerce is a lightweight, security-first PDF invoicing plugin that generates WooCommerce order PDFs on demand — without heavy background queues, and without filling your uploads folder with permanently stored PDFs.
It’s built around practical store requirements:
– Stable document identifiers/numbering history (so regenerated PDFs stay consistent)
– Secure Dompdf rendering defaults (chrooted paths, remote disabled by default, PHP in templates disabled by default)
– Theme template overrides and developer hooks
– Clean admin preview/download workflow on the order screen
– Customer “My Account” download buttons and order table actions (optional)
– Configurable WooCommerce email attachments that clean up temp files automatically
This plugin uses Dompdf (installed as a Composer dependency). If you are building from source, you must run Composer so the vendor/ directory (Dompdf) is present. The WordPress.org release includes the required library.
Document types are registered in a document registry and can be extended via filters.
Secure by default
– Dompdf configured with strict defaults:
– chroot limited to allowed paths
– remote resource fetching disabled by default
– PHP execution inside templates disabled by default (opt-in only)
– All admin/customer download actions are protected with nonces and permission checks.
No bloat
– PDFs are generated only when needed.
– Email attachments are created as temporary files and automatically cleaned up at shutdown.
– No custom database tables.
Built for WooCommerce documents
– Refund-aware credit notes
– Email attachment mapping
– Customer download links in the right places
– Store-friendly templates and template override system
Modular + extensible
Modules (Admin / Settings / Invoicing / Email / Frontend) are registered through a module manager and can be filtered for extension.
Settings page under the shared Kitgenix menu includes:
– Company name, address, email/phone, tax ID
– Logo upload (WordPress media)
– Footer text and customer notes/footer notes
– Document prefixes:
– Invoice prefix
– Receipt prefix
– Credit note prefix
– Template style selector (Standard / Simple / Modern / Business)
– Colour settings:
– Primary colour
– Accent colour
– Text colour
– Muted text colour
– Border colour
– Table header background
– Document background
– Footer background
– Footer text colour
On WooCommerce order edit screens the plugin adds document actions:
– Download Invoice (PDF)
– Download Packing Slip (PDF)
– Download Receipt (PDF)
– Download Credit Note (PDF) (only shown when refunds exist)
Endpoints are secured using nonce + capability checks.
For documents that require stable numbering (invoices/credit notes), the plugin persists document identifiers and relevant timestamps on first generation so the document remains consistent over time.
Templates can be overridden without editing plugin files.
Template resolution order:
1) Full override via filter
2) Theme override path:
kitgenix-pdf-invoicing-for-woocommerce/{style}/
3) Plugin templates fallback:
templates/{style}/
Where {style} is the active template pack selected in settings: standard, simple, modern, or business.
For compatibility, the resolver also checks .../standard/ and legacy root locations if a file is not found.
Optional customer-facing downloads for the order owner:
– Order details page buttons:
– Download Invoice (PDF)
– Download Credit Note (PDF) (only when refunds exist)
– My Account Orders table actions:
– View Invoice
– View Credit Note (when refunds exist)
Customer downloads are nonce-protected and/or can be validated by order key for guest access (see “Download permissions”).
PDF rendering supports secure query-arg requests:
– kitgenix_pdf=1
– kitgenix_doc={type}
– order_id={id}
– _wpnonce=…
Guest access (without a nonce) is permitted only when a valid WooCommerce order key is provided:
– key= or order_key= must match the order’s key
Default per-document rules:
– Invoice + Receipt:
– order owner OR shop staff OR valid order key
– Packing Slip:
– shop staff only (by default)
– Credit Note:
– staff OR order owner (only if refunds exist) OR valid order key (only if refunds exist)
Final permission gate is filterable.
Attach PDFs to WooCommerce emails using settings and filters.
The plugin hooks WooCommerce’s email attachment pipeline, generates PDFs as temporary files for each email, attaches them, and cleans up automatically.
Sensible defaults (customisable):
– Invoice: Processing + Completed
– Receipt: Completed
– Credit Note: Refunded
– Packing Slip: New Order (admin email)
To customise layout, copy templates into your theme override folder and edit them.
Copy templates from:
templates/{style}/
Paste into your theme at:
kitgenix-pdf-invoicing-for-woocommerce/{style}/
Edit the theme copies.
The plugin will automatically use your theme templates instead of bundled templates.
Text domain:
kitgenix-pdf-invoicing-for-woocommerce
Architecture:
– Modular plugin with Admin/Settings/Invoicing/Email/Frontend modules
– Document types registry (extendable)
– Template system with theme overrides + HTML/CSS filters
– Secure download endpoints with nonce/capability checks and optional order key validation
Key filters:
– kitgenix_pdf_invoicing_modules
– kitgenix_pdf_document_types
– kitgenix_pdf_document_enabled
– kitgenix_pdf_document_user_can_download
– kitgenix_pdf_document_filename
– kitgenix_pdf_invoice_filename (back-compat)
– kitgenix_pdf_document_attachment (inline vs download)
– kitgenix_pdf_document_template_path
– kitgenix_pdf_document_html
– kitgenix_pdf_invoice_html (back-compat)
– kitgenix_pdf_document_custom_css
– kitgenix_pdf_document_lang
– kitgenix_pdf_document_title
– kitgenix_pdf_document_body_class
– kitgenix_pdf_show_shipping_address
– kitgenix_pdf_email_document_map
– kitgenix_pdf_email_attach_document
– kitgenix_dompdf_enable_php (advanced; default false)
Key actions:
– kitgenix_before_stream_pdf_document
– kitgenix_after_stream_pdf_document
– kitgenix_before_stream_pdf_invoice (back-compat)
– kitgenix_after_stream_pdf_invoice (back-compat)
– Template hooks:
– kitgenix_pdf_before_document / kitgenix_pdf_after_document
– kitgenix_pdf_before_document_wrapper / kitgenix_pdf_after_document_wrapper
– kitgenix_pdf_after_notes
– kitgenix_pdf_after_order_data_rows
kitgenix_pdf_invoicing_settings.kitgenix_pdf_invoicing_for_woocommerce_metrics._kitgenix_pdf_invoicing_for_woocommerce_invoice_number_kitgenix_pdf_invoicing_for_woocommerce_invoice_date_kitgenix_pdf_invoicing_for_woocommerce_receipt_number_kitgenix_pdf_invoicing_for_woocommerce_receipt_date_kitgenix_pdf_invoicing_for_woocommerce_credit_note_count_kitgenix_pdf_invoicing_for_woocommerce_credit_note_historySecurity identifiers (exact):
– Admin meta box downloads use admin-post.php actions kitgenix_admin_stream_invoice, kitgenix_admin_stream_receipt, kitgenix_admin_stream_packing_slip, kitgenix_admin_stream_credit_note, protected by query arg nonce created/verified with nonce action kitgenix_admin_pdf.
– WordPress action hooks for those admin-post actions: admin_post_kitgenix_admin_stream_invoice, admin_post_kitgenix_admin_stream_receipt, admin_post_kitgenix_admin_stream_packing_slip, admin_post_kitgenix_admin_stream_credit_note.
– Frontend document downloads use the optional _wpnonce value created/verified with nonce action kitgenix_download_{doc_type}_{order_id}.
– WooCommerce order action key: kitgenix_download_pdf_invoice (hook: woocommerce_order_action_kitgenix_download_pdf_invoice).
Admin page hook suffix:
– kitgenix_page_kitgenix-pdf-invoicing-settings
PDF generation is performed locally on your server using Dompdf. This plugin does not send customer data to a third-party PDF generation API.
This plugin includes a shared “Kitgenix hub” component in wp-admin which may fetch publicly available plugin metadata from WordPress.org using WordPress core’s plugins_api() function.
Caching:
– Transient: kitgenix_hub_wporg_active_installs_v1
– Transient: kitgenix_hub_wporg_ratings_v1
Uninstall removes the plugin settings option (kitgenix_pdf_invoicing_settings) and metrics option (kitgenix_pdf_invoicing_for_woocommerce_metrics) when uninstalled via WordPress.
It also deletes the activation redirect transient: kitgenix_pdf_invoicing_for_woocommerce_do_activation_redirect.
Order meta and document history are intentionally preserved to avoid accidental loss of invoice/credit note history.
If this plugin helps you generate clean WooCommerce PDFs and reduces admin work, you can support ongoing development here:
https://buymeacoffee.com/kitgenix
Built with ❤︎ by @kitgenix – https://kitgenix.com
Bundled library: Dompdf (see vendor/ for licenses)