RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Implementing new EU invoice format (which is required for B2B from 2025)

From 2025, all B2B invoices within European Union must be machine readable by complying to a XML-spec (Factur-X). In this post, I use secretariat Gem for generating + validating the XML and then use plain Ghostscript to put it together with the original invoice.pdf into a hybrid so-called ZUGFeRD file that complies with the spec but still displays as a normal PDF(/A3).

https://www.stefanwienert.de/blog/2024/11/26/zugferd-x-rechnung-create-required-pdf-format-for-eu-compliance-for-2024-in-rails-ghostscript/

Comments

If you create the invoice.pdf yourself, you could use HexaPDF to do everything at once: Create the PDF as PDF/A-3b (see e.g. https://hexapdf.gettalong.org/examples/pdfa.html) and embed the XML file. Then no external tools would be needed.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in