WooCommerce PDF Invoice

WooCommerce PDF Invoices

WooCommerce PDF Invoices attaches a fully customizable PDF invoice to a paid or completed order and other WooCommerce emails.

Invoices can accessed via a Download Invoice link on the Thank You page or in the My Orders area and be resent by selecting Completed Order from the order actions meta box.

The layout of templates is fully customizable, and fields can be added or removed as needed.

Installation and Updating

For a new installation please review our extension installation guide

If you need to update the extension you can do this from your WordPress admin if you have connected the site to WooCommerce.com, you can read more about that here

You can also update manually by downloading the latest version from your WooCommerce account

Once you have the zip file downloaded you should deactivate and delete the existing version from your WordPress plugins page and then install the new version using the upload option. You will not lose any settings or data by updating this way.

Setup and Configuration

PDF Invoice settings can be found in the PDF Invoice menu which is located in the WooCommerce menu tab. Complete the settings form, there are tool tips (?) if you need more information on a setting.

It’s important to remember that an invoice is a legal document, and the format shouldn’t be changed once set up.

Date Format

You can set the format of the invoice date, using standard PHP date functions: (http://php.net/manual/en/function.date.php)

An example of the chosen date format is shown in the PDF Invoice settings once saved.

Screen Shot 2013-07-08 at 09.03.58


  • d M Y : 08 Jul 2013
  • j F, Y : 8 July, 2013
  • d-m-y : 08-07-13

Testing Invoice Layouts

To test your layout and settings, create a test order and set it to completed.

All orders, completed or otherwise, will have a “Download Invoice” icon in the actions area:

Screen Shot 2013-07-06 at 12.41.53

Click and check the invoice layout.

PDF File Name Parameters

The PDF filename should be unique and easy to spot for customers. Use up to 3 variables and any other text. For example:

INVOICE {{company}}-{{invoicenumber}}-{{invoicedate}}

would give a file name of INVOICE-WooThemes-AAA1234BBB-12052013.pdf

You can arrange the variables in any order.

PDF Invoice Number Suffix

If required, the invoice number suffix can include the current year. Add:


to the suffix setting.

Create Invoices for Existing Orders

If you need to create an invoice for a previously completed order, just resend the Completed Order email from the Order Actions meta box.

Order Screen

Order Layout

The PDF invoice extension adds new features to the WooCommerce Orders screen.

Screen Shot 2013-07-06 at 12.41.53-1

  • Invoice number: Click to download an invoice to your computer.
  • Send invoice icon: Click to resend a Completed Order email to the customer
  • Download invoice icon: Click to download a copy of the invoice to your computer. This icon shows for all orders, completed or otherwise. If the order is incomplete, no invoice will be shown for the downloaded PDF.

By default the actions column is hidden by WooCommerce, you can enable it in Screen Options

Bulk Actions Drop Down Menu

If you need to modify the existing PDF Invoice information, for example if the wrong date is on the invoice or the format needs to be changed you can make changes with the “Update PDF Meta” option. It will only show if the debugging option has been set in PDF Invoice settings – Please ensure you are aware of any potential legal issues before using this option.. Ideally, make the necessary changes in your settings if required and then update one invoice to confirm that everything has worked correctly.

If you want to create invoices for some orders that do not already have an invoice number you can use the “Create and Email Invoice”. There is a filter available to prevent the email from being sent.

add_filter( ‘pdf_invoice_bulk_send_invoice’, ‘remove_pdf_invoice_bulk_send_invoice’ );
function remove_pdf_invoice_bulk_send_invoice() {
return false;
view rawgistfile1.txt hosted with ❤ by GitHub

This option will work for past orders, especially if the option in the settings is timing out.


A PDF will be attached to all Paid or Completed Order emails.

Customers can get a PDF invoice via a Download Invoice link on the Thank You page or access copies from their My Orders area.

You can also attach a PDF to the ‘New Order’ emails received by the store admin.


Copy the template to your theme

To customize the template, first create a copy in your theme.


Once the file is ready, you can edit.

Add new placeholders

see Hooks and Filters in WooCommerce PDF Invoice for more information — and change the layout and move sections around.

Template files use HTML tables. This is a limitation of the DOMPDF library, in that some CSS classes can be used, but you’ll need to experiment to see which work and which don’t.

Using the included fonts


You can then change the font in the template.php file. If the font is not included with DOMPDF, you can use Google Fonts. Add a link to template.php and then add the style as you would in a normal HTML file.

Using Google Fonts

Get the font url from Google (https://fonts.google.com) and then modify the template as follows. It is important that your font contains all of the necessary characters for your language and it should also contain enough styles for normal, bold, H1, H2.

    @import url('https://fonts.googleapis.com/css?family=Orbitron');

    body {
      font-family: 'Orbitron', sans-serif, "DejaVu Sans Mono", sans-serif, monospace;

Using a True Type font

Make sure you know the location of the font and then modify the template as follows. It is important that your font contains all of the necessary characters for your language and it should also contain enough styles for normal, bold, H1, H2.

    @font-face {
      font-family: 'Firefly';
      font-style: normal;
      font-weight: normal;
      src: url(http://example.com/fonts/firefly.ttf) format('truetype');
    body {
      font-family: 'Orbitron', sans-serif, "DejaVu Sans Mono", sans-serif, monospace;

Adding background colour to the PDF product lines

Requires PDF Invoices 4.4.5

Add the following CSS to your PDF template

      .orderdetails, .ordercontent {
          border-collapse: collapse;
      .orderdetails tr, .orderdetails th, .orderdetails td,
      .ordercontent tr, .ordercontent th, .ordercontent td {
          margin: 0;
          padding: 2px 4px;
      .pdf_table_heading_row {
          background-color: #000;
          color: #FFF;
      .pdf_table_row_even {
          background-color: #cacaca;          
      .pdf_table_row_odd {

Using Hooks and Filters

For more information on hooks and filters in WooCommerce PDF Invoice, see: Hooks and Filters in WooCommerce PDF Invoice.

Translating PDF Invoice

You can use the free Loco Translate plugin to translate any or all of of the strings in PDF Invoice. If you only want to change two or three strings, then the Say What? free plugin may be better suited. (Use the domain: woocommerce-pdf-invoice)

If you use Loco Translate and keep custom translations in woocommerce-pdf-invoice/languages, they can be lost when upgrading. To keep them upgrade safe, place them in wp-content/languages/woocommerce-pdf-invoice/


Are PDFs stored in a secure way?

PDFs are created as needed and stored in your hosting tmp folder, which isn’t typically accessible from a browser. A CRON task deletes PDFs every half hour to avoid filling up your server.

Bulk Exporting PDFs

From version 4.0.0 of WooCommerce PDF Invoice there is an ability for store owners to create a zip file of several invoices. This is version 1 of bulk exporting. Future releases of WooCommerce PDF Invoice will improve on this, based on feedback from store owners. Please email any ideas or feedback to plugins@chromeorange.co.uk

To export several PDFs, view your order list, select the orders you want the PDFs for, choose “Bulk Export PDFs” from the “Bulk Actions” drop down and click “Apply”. Once the zip file is available there will be a link to download it.

bulk export pdfs

Editing invoices

From version 4.2.0 of PDF Invoices it is possible to modify previously uneditable invoice data.

To access this the PDF debugging option should be set to yes. Once that is done edit the order that needs to be modified and look for the Invoice meta box, usually at the bottom of the page.

Before making any changes here you should be aware of any legal issues that may occur if you modify an invoice that has already been issued to a customer, if you are not sure please consult your accountant.

Feedback and feature requests

For feedback on the PDF Invoice extension, this documentation or for feature requests please email plugins@chromeorange.co.uk

You must log in and be a buyer of this download to submit a review.