XRechnung
webPDF offers the possibility to create a visual image of XRechnung documents1. For this purpose, the corresponding XML data of an XRechnung is converted into a PDF document via the transformation of the Converter web service. The XML data is converted into HTML documents via transformation and then converted into a PDF document.
webPDF does not perform XRechnung document creation, it just creates a visual image of an existing XRechnung as a PDF document.
If the XML data of an XRechnung1 (EN 16931-1:2017 - Semantic data model and data types) is available and is passed as an output document at the Converter web service, the transformation to HTML can be executed via the transform and xrechnung parameter:
{
"converter": {
"transform": {
"xRechnung": {
}
}
}
}
After performing the transformation, the created HTML document is converted into a PDF document. The webPDF server has a default layout for the visual conversion of the XRechnung. This default layout, unless a visualization block is specified, is automatically used during the transformation.
The standard layout is based on the project https://github.com/itplr-kosit of the Coordination Office for IT Standards of the Free City of Bremen (https://www.xoev.de/)
In order for the transformation to be performed correctly, the XRechnung data must be available in the following syntaxes or syntax bindings:
- CII (UN/CEFACT - Cross Industry Invoice XML)
- UBL (ISO/IEC 19845 - Universal Business Language Version 2.1 - Invoice)
- UBL (ISO/IEC 19845 - Universal Business Language Version 2.1 - Credit Note)
The server performs an automatic recognition of the XRechnung data. Therefore it is important that the data is mapped into a "well-formed XML document" with full namespace support (qualified names).
Optionally, when transforming an XRechnung, its own appearance can also be specified via the visualization element. For this, the corresponding one to n XSLT resources must be defined via "file".
{
"converter": {
"transform": {
"xRechnung": {
"visualization": {
"file": [
{
"fileName": "",
"format": "xslt",
"source": "value",
"uri": "",
"value": ""
}
]
}
}
}
}
The output of the XSLT transformation must be an HTML document so that it can subsequently be converted into a PDF. Besides the XSLT, other resources such as CSS stylesheets can also be passed.
When building your own visual representation, you should use the examples from the https://github.com/itplr-kosit/xrechnung-visualization project as a guide.
The PDF document created in this way, as an image of the XRechnung, can then be converted into a ZUGFeRD document via the pdfa web service if required.