Class FacturXDocumentAttachment
A file attached to the Factur-X PDF.
Assembly: FacturXDotNet.dll
csharp
public class FacturXDocumentAttachment
Derived:
FacturXDotNet.CrossIndustryInvoiceAttachment
Properties
Name
The name of the attachment.
csharp
public string Name { get; }
Methods
ReadAsync(string?, CancellationToken)
Read the attachment from the Factur-X document to memory.
csharp
public Task<ReadOnlyMemory<byte>> ReadAsync(string? password = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<System.ReadOnlyMemory<System.Byte>>
: The attachment content.
Parameters
Type | Name | Description |
---|---|---|
System.String | password | The password to open the PDF document. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Exceptions
System.InvalidOperationException
The attachment with the specified name could not be found.
CopyToAsync(Stream, string?, CancellationToken)
Write the attachment from the Factur-X document to a stream.
csharp
public Task CopyToAsync(Stream outputStream, string? password = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | outputStream | The stream to write the attachment to. |
System.String | password | The password to open the PDF document. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
FindAttachmentStreamAsync(string?, CancellationToken)
Get the stream of the attachment from the Factur-X document.
csharp
protected Task<Stream> FindAttachmentStreamAsync(string? password = null, CancellationToken cancellationToken = default)
Returns
System.Threading.Tasks.Task<System.IO.Stream>
: The attachment stream.
Parameters
Type | Name | Description |
---|---|---|
System.String | password | The password to open the PDF document. |
System.Threading.CancellationToken | cancellationToken | The cancellation token. |
Exceptions
System.InvalidOperationException
The attachment with the specified name could not be found.