javascripte-commerceinvoicezugferd

Creating invoice pdf within ZUGFeRD xml embeded on MERN project


I am trying to create an invoice pdf with ZUGFeRD format on my site. After customer placing his order, the order information should be saved in ZUGFeRD xml file and then create invoice pdf file which has the xml file as an attachment. The project is built with MERN stack. I tried to find solutions online but there we only JAVA and C# built-in libraries. Is there any library for javascript projects to handle ZUGFeRD invoicing? If it needs to be built from the ground up, which steps should be needed?

Thank you for your advice!


Solution

  • Since the xml is to comply with Zugferd/Factur-X then it is a very specialist embed to match the standards. Hevierweight Java or C# is required for speed, though you could command line from any script outside of restricted HTML.js

    This is European Plutocracy at its finest, only those controlling money will pay each other. For a wider code orientated usage definition see https://duckduckgo.com/?q=EN+%2B16931

    The key coding elements shown here. Are a strictly defined XML input (4 page on right in example) (could have been much simpler written as ODT) is processesed to generate a 100% synchronized colour PDF output (1 page in example on left) Which then in turn must include the 100% verifiable XML source and colour profile plus fonts!, all wrapped into one PDFA archive (could have been simpler if as just one Zipped.docX but was not to be!).

    XML embedded in PDF for extract and process enter image description here

    You will need to ensure your XML matches the PDF data with respect to layout and that is entirely down to customer customization, so nobody here can guide on that step. However, it then (IMHO stupidly) requires a precise combination of colour profile and matching colour setting!, those can be auto templated for command line insertion, but you must get it right once, so its repeatable.

    Thus you should be able to do it using Ghostscript and read carefully https:/ghostscript.com/blog/zugferd.html however Ghostscript should naturally be licensed by you for your commercial use.

    For an alternative Java based Open Source up to date project see the Mustang Project

    It is not a lightweight read in either case, but for compatibly consider both tools and compare.