2. Scenario - XMLToFacturX 

Page / - last modified by Outhman Moustaghfir on 2022/06/13 13:18 

XMLToFacturX 
last modified by Outhman Moustaghfir
on 2022/06/13 13:18

Table of Contents
Introduction
Parameters
Use case

 
Introduction
This document aims to give a global view on how to create a FacturX, a PDF-based format for electronic invoices, by using the XMLToFacturX connector.
Parameters
XMLToFacturX requires 3 parameters : 
•	Output FileName :  the folder and the name of the output FacturX, eg: '/out/facturX.pdf' , '/work/newFacturX.pdf' ... 
•	NB: putting the output FacturX in the "out" directory, allows to show and download from the exploitation page.
•	Input Charset: the charset used for the input file. set by default to UTF-8.
•	Output Charset: the charset used for the output file. set by default to UTF-8. 
Use case
To use the XMLToFacturX correctly, it must be preceded by a gateway (inclusive or parallel) that links it to another 2, and only 2 connectors, one generates an XML file structure, and the other sends its invoice in PDF format, and that is to ensure having both files before triggering XMLToFacturX connector.
let's take a simple example to understand the functionality of the connector : 
              
Here, we have created a simple scenario that load 2 files using the LoadFile connector after starting the process with an AppEventListener :
•	LoadFile1 loads an XML file named 'facturx.xml'.
•	LoadFile2 loads a PDF File named 'Invoice.pdf'. 
As already mentioned, the next connector must be a gateway, in this case, we have called an inclusive gateway. After loading both files successfully, the process can trigger the XMLToFacturX connector.
Now, we can observe the difference by opening the output file on Adobe Acrobat Reader, by just clicking on the paperclip symbol to see the embedded XML structure.