![]() |
VOOZH | about |
dotnet add package Securibox.FacturX --version 0.5.4
NuGet\Install-Package Securibox.FacturX -Version 0.5.4
<PackageReference Include="Securibox.FacturX" Version="0.5.4" />
<PackageVersion Include="Securibox.FacturX" Version="0.5.4" />Directory.Packages.props
<PackageReference Include="Securibox.FacturX" />Project file
paket add Securibox.FacturX --version 0.5.4
#r "nuget: Securibox.FacturX, 0.5.4"
#:package Securibox.FacturX@0.5.4
#addin nuget:?package=Securibox.FacturX&version=0.5.4Install as a Cake Addin
#tool nuget:?package=Securibox.FacturX&version=0.5.4Install as a Cake Tool
Factur-X is a new French and German standard for electronic invoicing, expanding the German ZUGFeRD standard. It represents the first implementation of the European Commission’s European Semantic Standard EN 16931, introduced in 2017 by the FNFE-MPE. Factur-X belongs to a class of e-invoices known as mixed or hybrid invoices, that combine PDFs for users and XML data for automated processing. This library uses Factur-X version 1.08, applicable as of January 15th 2026.
Several standard data profiles are available with more or less information:
This library, developed in .NET 8.0, allows you to easily perform the following tasks:
To use this library in your C# project, you can either download the Securibox.FacturX library directly from our Github repository or if you have the NuGet package manager installed or Visual Studio, you can grab it automatically:
dotnet add package Securibox.FacturX
Once you have the Securibox FacturX library installed, you can include calls to it in your code. For sample implementations, see the tests in the Securibox.FacturX.Tests project.
Securibox.FacturX library utilises the following MIT licensed projects:
In order to read a Factur-X PDF invoice you only need to :
var importer = new FacturxImporter("C:\\Path\\To\\Facture.pdf"));
var crossIndustryInvoice = importer.ImportDataWithDeserialization();
var invoice = crossIndustryInvoice as FacturX.SpecificationModels.Profile.CrossIndustryInvoice;
In the following examples we are reading a Factur-X PDF invoice with a Minimum and Basic profiles.
var importer = new FacturxImporter("C:\\Path\\To\\Facture_UE_MINIMUM.pdf"));
var crossIndustryInvoice = importer.ImportDataWithDeserialization();
var invoice = crossIndustryInvoice as FacturX.SpecificationModels.Minimum.CrossIndustryInvoice;
In the following example we are reading a Factur-X PDF invoice with a Basic profile.
var importer = new FacturxImporter("C:\\Path\\To\\Facture_UE_BASIC.pdf"));
var crossIndustryInvoice = importer.ImportDataWithDeserialization();
var invoice = crossIndustryInvoice as FacturX.SpecificationModels.Basic.CrossIndustryInvoice;
To validate the factur-x you just need to call IsFacturXValid() method.
This method performs both XSD schema and Schematron validation of the embedded XML inside a Factur-X PDF. It also checks the PDF/A-3 conformance and XMP metadata.
A Factur-X invoice is considered valid if: - it is a valid PDF/A-3; - it has a valid XMP; - the embebed xml is valid against the profile xsd; - the embebed xml is valid against the profile schematron.
Below an example is shown :
var importer = new FacturxImporter(@"C:\Path\To\Facture.pdf"));
importer.IsFacturXValid();
The output: - Returns true if the Factur-X file is fully valid. - Returns false if any Schematron rules fail or warnings are found. - All issues (errors or warnings) are accessible through the public field:
public List<ValidationReport> validationReport;
If IsFacturXValid() returns false, the list validationReport will contain one or more EvaluationResult objects, which detail exactly what went wrong or needs attention. An Error (IsError = true) means the Factur-X invoice does not comply with required rules. A Warning (IsWarning = true) usually corresponds to a <report> rule in the Schematron, not critical but should be addressed. These are both included in the validationReport list.
These are both included in the validationReport list.
In order to generate a pdf invoice from a valid xml you will need to create a new CrossIndustryInvoice, matching the profile you want, this object will be used to generate the xml for your invoice. After that, you just need to create a new FacturXExporter and call the method CreateFacturXStream.
CreateFacturXStream(@".\path\InvoiceToExtract.pdf", crossIndustryInvoice , invoiceName, invoiceDescription);
The arguments invoiceName and invoiceDescription are optional.
Below you will find an extensive example of a facturx creation.
Securibox.FacturX.SpecificationModels.Minimum.CrossIndustryInvoice invoiceToExport = new Securibox.FacturX.SpecificationModels.Minimum.CrossIndustryInvoice()
{
ExchangedDocument = new SpecificationModels.Minimum.ExchangedDocument()
{
ID = new SpecificationModels.Minimum.ID() { Value = "2023-6026" },
IssueDateTime = new SpecificationModels.Minimum.IssueDateTime() { DateTimeString = new SpecificationModels.Minimum.DateTimeString() { Value = "20230928", Format = "102" } },
TypeCode = "380"
},
ExchangedDocumentContext = new SpecificationModels.Minimum.ExchangedDocumentContext()
{
BusinessProcessSpecifiedDocumentContextParameter = new SpecificationModels.Minimum.DocumentContextParameter()
{
ID = new SpecificationModels.Minimum.ID() { Value = "A1" },
},
GuidelineSpecifiedDocumentContextParameter = new SpecificationModels.Minimum.DocumentContextParameter()
{
ID = new SpecificationModels.Minimum.ID() { Value = "urn:factur-x.eu:1p0:minimum" }
},
},
SupplyChainTradeTransaction = new SpecificationModels.Minimum.SupplyChainTradeTransaction()
{
ApplicableHeaderTradeAgreement = new SpecificationModels.Minimum.HeaderTradeAgreement()
{
BuyerTradeParty = new SpecificationModels.Minimum.TradeParty()
{
Name = "Securibox SARL",
SpecifiedLegalOrganization = new SpecificationModels.Minimum.LegalOrganization()
{
ID = new SpecificationModels.Minimum.ID() { Value = "50000371000034", SchemeID = "0002" },
}
},
SellerTradeParty = new SpecificationModels.Minimum.TradeParty()
{
Name = "Société Hôtelière du Pacano",
SpecifiedLegalOrganization = new SpecificationModels.Minimum.LegalOrganization()
{
ID = new SpecificationModels.Minimum.ID()
{
Value = "12345682400016",
SchemeID = "0002"
},
},
PostalTradeAddress = new SpecificationModels.Minimum.TradeAddress()
{
CountryID = "FR"
}
},
},
ApplicableHeaderTradeDelivery = new SpecificationModels.Minimum.HeaderTradeDelivery() { },
ApplicableHeaderTradeSettlement = new SpecificationModels.Minimum.HeaderTradeSettlement()
{
InvoiceCurrencyCode = "EUR",
SpecifiedTradeSettlementHeaderMonetarySummation = new SpecificationModels.Minimum.TradeSettlementHeaderMonetarySummation()
{
TaxBasisTotalAmount = new SpecificationModels.Minimum.Amount() { Value = 207.55m },
TaxTotalAmount = new SpecificationModels.Minimum.Amount() { Value = 20.59m, CurrencyID = "EUR" },
GrandTotalAmount = new SpecificationModels.Minimum.Amount()
{
Value = 228.14m,
},
DuePayableAmount = new SpecificationModels.Minimum.Amount()
{
Value = 228.14m,
},
},
},
}
};
var inputNonFacturxPdfPath = @"c:\path\to\notAFacturX.pdf";
var outputPath = @"c:\path\to\facturx.pdf";
FacturxExporter exporter = new FacturxExporter();
using (var outputStream = new new FileStream(outputPath, FileMode.Create))
{
using (var stream = exporter.CreateFacturXStream(
inputNonFacturxPdfPath,
invoiceToExport,
"Invoice 2023-6026",
"Hotel payment"))
{
await stream.CopyToAsync(outputStream);
}
}
Happy coding!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.6.0-alpha-1 | 105 | 5/5/2026 |
| 0.5.4 | 768 | 3/25/2026 |
| 0.5.3 | 566 | 1/16/2026 |
| 0.5.2 | 1,086 | 10/31/2025 |