Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @DevExpressExampleBot
46 changes: 33 additions & 13 deletions CS/ZUGFeRD_sample/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 56 additions & 21 deletions CS/ZUGFeRD_sample/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,62 @@ public Form1() {
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e) {
var report = new XtraReport1();
report.XmlDataPath = "ZUGFeRD-rechnung.xml";

string additionalMetadata =
File.ReadAllText("ZUGFeRD_DocumentInfo.txt") +
File.ReadAllText("ZUGFeRD_PdfASchema.txt");

PdfExportOptions options = new PdfExportOptions() {
PdfACompatibility = PdfACompatibility.PdfA3b,
AdditionalMetadata = additionalMetadata
};

options.Attachments.Add(new PdfAttachment() {
FilePath = "ZUGFeRD-rechnung.xml",
Type = "text/xml",
Description = "Rechnungsdaten im ZUGFeRD-XML-Format",
});

report.ExportToPdf("result.pdf", options);
Process.Start("result.pdf");
// Refer to chapter 6.2 of the FACTUR-X 1.08 specification
private void ButtonExportGermany_Click(object sender, EventArgs e) {
using (var report = new XtraReport1())
{
report.XmlDataPath = "German//xrechnung.xml";

string additionalMetadata =
File.ReadAllText("German//ZUGFeRD_DocumentInfo.txt") +
File.ReadAllText("German//ZUGFeRD_PdfASchema.txt");

PdfExportOptions options = new PdfExportOptions()
{
PdfACompatibility = PdfACompatibility.PdfA3b,
AdditionalMetadata = additionalMetadata
};

// Refer to chapter 7.7 of the ZUGFeRD specification.
options.Attachments.Add(new PdfAttachment()
{
FilePath = "German//xrechnung.xml",
Type = "text/xml",
Relationship = PdfAttachmentRelationship.Alternative,
Description = "Rechnungsdaten im ZUGFeRD-XML-Format",
});

report.ExportToPdf("germanResult.pdf", options);
Process.Start("germanResult.pdf");
}
}

private void ButtonExportFrance_Click(object sender, EventArgs e) {
using (var report = new XtraReport1())
{
report.XmlDataPath = "French//factur-x.xml";
string additionalMetadata =
File.ReadAllText("French//ZUGFeRD_DocumentInfo.txt") +
File.ReadAllText("French//ZUGFeRD_PdfASchema.txt");

PdfExportOptions options = new PdfExportOptions()
{
PdfACompatibility = PdfACompatibility.PdfA3b,
AdditionalMetadata = additionalMetadata
};

// Refer to chapter 7.7 of the FACTUR-X 1.08 specification
options.Attachments.Add(new PdfAttachment()
{
FilePath = "French//factur-x.xml",
Type = "text/xml",
Relationship = PdfAttachmentRelationship.Data,
Description = "Facture XML conforme Factur-X",
});

report.ExportToPdf("frenchResult.pdf", options);
Process.Start("frenchResult.pdf");
}
}
}
}
6 changes: 6 additions & 0 deletions CS/ZUGFeRD_sample/French/ZUGFeRD_DocumentInfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<rdf:Description xmlns:fx="urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#" rdf:about="">
<fx:DocumentType>INVOICE</fx:DocumentType>
<fx:DocumentFileName>factur-x.xml</fx:DocumentFileName>
<fx:Version>1.0</fx:Version>
<fx:ConformanceLevel>BASIC</fx:ConformanceLevel>
</rdf:Description>
42 changes: 42 additions & 0 deletions CS/ZUGFeRD_sample/French/ZUGFeRD_PdfASchema.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"
xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#"
xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"
rdf:about="">
<pdfaExtension:schemas>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<pdfaSchema:schema>Factur-X PDFA Extension Schema</pdfaSchema:schema>
<pdfaSchema:namespaceURI>urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#</pdfaSchema:namespaceURI>
<pdfaSchema:prefix>fx</pdfaSchema:prefix>
<pdfaSchema:property>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<pdfaProperty:name>DocumentFileName</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>external</pdfaProperty:category>
<pdfaProperty:description>The name of the embedded Factur-X XML invoice file</pdfaProperty:description>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<pdfaProperty:name>DocumentType</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>external</pdfaProperty:category>
<pdfaProperty:description>INVOICE</pdfaProperty:description>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<pdfaProperty:name>Version</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>external</pdfaProperty:category>
<pdfaProperty:description>The version of the Factur-X data</pdfaProperty:description>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<pdfaProperty:name>ConformanceLevel</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>external</pdfaProperty:category>
<pdfaProperty:description>The conformance level of the Factur-X data, i.e. EN16931</pdfaProperty:description>
</rdf:li>
</rdf:Seq>
</pdfaSchema:property>
</rdf:li>
</rdf:Bag>
</pdfaExtension:schemas>
</rdf:Description>
6 changes: 6 additions & 0 deletions CS/ZUGFeRD_sample/German/ZUGFeRD_DocumentInfo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<rdf:Description xmlns:fx="urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#" rdf:about="">
<fx:DocumentType>INVOICE</fx:DocumentType>
<fx:DocumentFileName>xrechnung.xml</fx:DocumentFileName>
<fx:Version>3.0</fx:Version>
<fx:ConformanceLevel>XRECHNUNG</fx:ConformanceLevel>
</rdf:Description>
39 changes: 39 additions & 0 deletions CS/ZUGFeRD_sample/German/ZUGFeRD_PdfASchema.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
<pdfaExtension:schemas>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<pdfaSchema:schema>ZUGFeRD PDFA Extension Schema</pdfaSchema:schema>
<pdfaSchema:namespaceURI>urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#</pdfaSchema:namespaceURI>
<pdfaSchema:prefix>fx</pdfaSchema:prefix>
<pdfaSchema:property>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<pdfaProperty:name>DocumentFileName</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>external</pdfaProperty:category>
<pdfaProperty:description>The name of the embedded Zugferd XML invoice file</pdfaProperty:description>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<pdfaProperty:name>DocumentType</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>external</pdfaProperty:category>
<pdfaProperty:description>INVOICE</pdfaProperty:description>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<pdfaProperty:name>Version</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>external</pdfaProperty:category>
<pdfaProperty:description>The version of the ZUGFeRD data</pdfaProperty:description>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<pdfaProperty:name>ConformanceLevel</pdfaProperty:name>
<pdfaProperty:valueType>Text</pdfaProperty:valueType>
<pdfaProperty:category>external</pdfaProperty:category>
<pdfaProperty:description>The conformance level of the ZUGFeRD data, i.e. BASIC or EXTENDED</pdfaProperty:description>
</rdf:li>
</rdf:Seq>
</pdfaSchema:property>
</rdf:li>
</rdf:Bag>
</pdfaExtension:schemas>
</rdf:Description>
156 changes: 156 additions & 0 deletions CS/ZUGFeRD_sample/German/xrechnung.xml

Large diffs are not rendered by default.

Empty file.
6 changes: 0 additions & 6 deletions CS/ZUGFeRD_sample/ZUGFeRD_DocumentInfo.txt

This file was deleted.

39 changes: 0 additions & 39 deletions CS/ZUGFeRD_sample/ZUGFeRD_PdfASchema.txt

This file was deleted.

19 changes: 15 additions & 4 deletions CS/ZUGFeRD_sample/ZUGFeRD_sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\licenses.licx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand Down Expand Up @@ -114,16 +115,26 @@
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="ZUGFeRD-rechnung.xml">
<Content Include="French\factur-x.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="ZUGFeRD_DocumentInfo.txt">
<Content Include="French\ZUGFeRD_DocumentInfo.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="ZUGFeRD_PdfASchema.txt">
<Content Include="French\ZUGFeRD_PdfASchema.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="German\xrechnung.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="German\ZUGFeRD_DocumentInfo.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="German\ZUGFeRD_PdfASchema.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand All @@ -132,4 +143,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
1 change: 0 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!-- default badges list -->
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/128597453/24.2.1%2B)
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T234531)
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
Expand Down
Loading