Skip to main content
Back to Articles
MagentoMay 29, 20255 min read

Magento 2 EU-Compliant Invoice Date PDF

By default, Magento 2 omits the invoice creation date from PDF invoices and ignores store-level locale settings. Our open-source PdfOverride module adds legally required dates, translates invoice text per store view, and ensures EU VAT Directive compliance out of the box.

Invoice PDFs That Match Your Customer's Language

If you operate a multilingual Magento 2 store, chances are you have invested heavily in localising the frontend. But what about the documents your customers actually keep -- invoices?

By default, Magento does not print the invoice creation date on PDF invoices and does not translate PDF content based on the store view where the order was placed. This is more than a UX oversight: under EU law, it is a legal compliance gap.

Our Solution: PdfOverride Module

We built a custom Magento 2 module called PdfOverride that addresses these shortcomings:

  • Adds Invoice Date and Order Date to the invoice header
  • Translates all phrases using Magento's i18n/*.csv structure
  • Dynamically switches the locale based on the order's store view
  • Provides a minimal override with maximum impact

Compatibility

  • Magento 2.4.8 (tested)
  • Works with multi-language, multi-store setups

Admin vs Customer Language

Previously, PDF output used the admin panel language regardless of which storefront the customer had used. With this module, the invoice language follows the store view the customer selected during checkout, correctly localising every field.

Why You Need This

  • EU regulations require the invoice issue date on every invoice.
  • Localised PDFs improve the customer experience and reduce tax and legal risks.
  • The module is easy to maintain and built with Magento best practices.

Why Is the Invoice Date Required?

EU law (VAT Directive 2006/112/EC, Article 226) mandates that every invoice include:

  • Invoice number
  • Invoice issue date
  • Date of supply (if different)
  • Seller and buyer information

Missing the invoice date can lead to rejection during audits or B2B transactions.

Multi-Language Support

The module supports store-based translations. When a customer places an order in your German store view, the invoice is generated with German text -- not based on your admin user's language.

Example: German CSV Translation

"Order # ","Bestellnummer:"
"Invoice Date: ","Rechnungsdatum:"
"Order Date: ","Bestelldatum:"
"Sold to:","Rechnung an:"
"Ship to:","Lieferung an:"
"Payment Method:","Zahlungsart:"
"Shipping Method:","Versandart:"
"Total Shipping Charges","Versandkosten"
"Title","Sendungstitel"
"Number","Nummer"
"Invoice # ","Rechnung Nr. "

Save this file as:

app/code/Vendor/PdfOverride/i18n/de_DE.csv

Collect phrases automatically with:

bin/magento i18n:collect-phrases -o app/code/Vendor/PdfOverride/i18n/de_DE.csv app/code/Vendor/PdfOverride

How the Locale Is Determined

The PDF generation function uses Magento\Store\Model\App\Emulation to dynamically switch to the store's locale before rendering the PDF. This ensures the correct translation file is loaded based on the store where the order originated.

Installation Instructions

cd app/code
mkdir -p Vendor && cd Vendor
git clone https://github.com/privatedevops/scripts.git
mv scripts/magento2/modules/PdfOverride PdfOverride

bin/magento module:enable Vendor_PdfOverride
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush

Folder Structure

Vendor/PdfOverride/
├── etc/
│   ├── di.xml
│   └── module.xml
├── i18n/
│   └── de_DE.csv
├── Model/
│   └── Order/
│       └── Pdf/
│           └── Invoice.php
└── registration.php

License & Source

This module is open source under the MIT license. Contributions are welcome.

Download on GitHub

Final Thoughts

Complying with EU invoice regulations does not have to be complicated. This module gives your Magento store a professional, legally compliant, multilingual invoicing experience -- essential for modern eCommerce.

Need further customisations or support? Contact us at Private DevOps.

Need help with this?

Our team handles this kind of work daily. Let us take care of your infrastructure.