Class FacturXDocument
A Factur-X document.
Assembly: FacturXDotNet.dll
public class FacturXDocument
Properties
Data
The raw document.
public ReadOnlyMemory<byte> Data { get; }
Methods
GetXmpMetadataStreamAsync(string?, CancellationToken)
Get the XMP metadata of the Factur-X document as a stream.
public Task<Stream> GetXmpMetadataStreamAsync(string? password = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<System.IO.Stream>
: The XMP metadata of the Factur-X document as a stream.
Parameters
Type | Name | Description |
---|---|---|
System.String | password | The password to open the PDF document. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
GetXmpMetadataAsync(string?, XmpMetadataReaderOptions?, CancellationToken)
Get the XMP metadata of the Factur-X document as a structured object.
public Task<XmpMetadata?> GetXmpMetadataAsync(string? password = null, XmpMetadataReaderOptions? xmpParserOptions = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<FacturXDotNet.Models.XMP.XmpMetadata>
: The XMP metadata of the Factur-X document.
Parameters
Type | Name | Description |
---|---|---|
System.String | password | The password to open the PDF document. |
FacturXDotNet.Parsing.XMP.XmpMetadataReaderOptions | xmpParserOptions | The options to parse the XMP metadata. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
GetCrossIndustryInvoiceAttachmentAsync(string?, string?, CancellationToken)
Get the Cross-Industry Invoice of the Factur-X document.
public Task<CrossIndustryInvoiceAttachment?> GetCrossIndustryInvoiceAttachmentAsync(string? attachmentFileName = null, string? password = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<FacturXDotNet.CrossIndustryInvoiceAttachment>
: The Cross-Industry Invoice of the Factur-X document.
Parameters
Type | Name | Description |
---|---|---|
System.String | attachmentFileName | The name of the attachment containing the Cross-Industry Invoice XML file. If not specified, the default name 'factur-x.xml' will be used. |
System.String | password | The password to open the PDF document. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
GetAttachmentsAsync(string?, CancellationToken)
Get the attachments of the Factur-X document.
public IAsyncEnumerable<FacturXDocumentAttachment> GetAttachmentsAsync(string? password = null, CancellationToken cancellationToken = default)
Returns
System.Collections.Generic.IAsyncEnumerable<FacturXDotNet.FacturXDocumentAttachment>
: The attachments of the Factur-X document.
Parameters
Type | Name | Description |
---|---|---|
System.String | password | The password to open the PDF document. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
ExportAsync(Stream)
Export the Factur-X document to a stream.
public Task ExportAsync(Stream outputStream)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | outputStream | The stream to write the Factur-X document to. |
Create()
Create a new Factur-X document builder. The builder must be configured with the desired PDF image, Cross-Industry Invoice, XMP metadata.
public static FacturXDocumentBuilder Create()
Returns
FacturXDotNet.Generation.FacturX.FacturXDocumentBuilder
LoadFromFileAsync(string, CancellationToken)
Create a new Factur-X document from a file.
public static Task<FacturXDocument> LoadFromFileAsync(string filePath, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<FacturXDotNet.FacturXDocument>
Parameters
Type | Name |
---|---|
System.String | filePath |
System.Threading.CancellationToken | cancellationToken |
LoadFromStream(Stream, CancellationToken)
Create a new Factur-X document from a stream.
public static Task<FacturXDocument> LoadFromStream(Stream stream, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<FacturXDotNet.FacturXDocument>
Parameters
Type | Name |
---|---|
System.IO.Stream | stream |
System.Threading.CancellationToken | cancellationToken |
LoadFromBuffer(ReadOnlyMemory<byte>)
Create a new Factur-X document from a buffer.
public static FacturXDocument LoadFromBuffer(ReadOnlyMemory<byte> buffer)
Returns
Parameters
Type | Name |
---|---|
System.ReadOnlyMemory<System.Byte> | buffer |