GdPicture.NET.14
GdPicture14 Namespace / GdPicturePDF Class / EmbedInvoiceData Method / EmbedInvoiceData(Stream,PdfInvoiceDataFormat) Method
The stream that contains invoice data to embed.
A member of the PdfInvoiceDataFormat enumeration, specifying the embedded xml invoice data format.
Example





In This Topic
EmbedInvoiceData(Stream,PdfInvoiceDataFormat) Method
In This Topic
Embeds (attaches) a invoice data from a previously instantiated Stream object into the currently loaded PDF document.
Syntax
'Declaration
 
Public Overloads Function EmbedInvoiceData( _
   ByVal Stream As Stream, _
   ByVal InvoiceDataFormat As PdfInvoiceDataFormat _
) As GdPictureStatus
public GdPictureStatus EmbedInvoiceData( 
   Stream Stream,
   PdfInvoiceDataFormat InvoiceDataFormat
)
public function EmbedInvoiceData( 
    Stream: Stream;
    InvoiceDataFormat: PdfInvoiceDataFormat
): GdPictureStatus; 
public function EmbedInvoiceData( 
   Stream : Stream,
   InvoiceDataFormat : PdfInvoiceDataFormat
) : GdPictureStatus;
public: GdPictureStatus EmbedInvoiceData( 
   Stream* Stream,
   PdfInvoiceDataFormat InvoiceDataFormat
) 
public:
GdPictureStatus EmbedInvoiceData( 
   Stream^ Stream,
   PdfInvoiceDataFormat InvoiceDataFormat
) 

Parameters

Stream
The stream that contains invoice data to embed.
InvoiceDataFormat
A member of the PdfInvoiceDataFormat enumeration, specifying the embedded xml invoice data format.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.

We strongly recommend always checking this status first.

Remarks
This method is only allowed for use with non-encrypted documents.

This method is only usable for PDF/A-3 documents.

Example
Embedding a text file into the PDF document using stream.
Using gdpicturePDF = New GdPicturePDF()
    gdpicturePDF.LoadFromFile("pdfa3.pdf", True)
    FileStream fs = new FileStream("factur-x.xml", FileMode.Open)
    gdpicturePDF.EmbedInvoiceData(fs, "Text Attachment")
    gdpicturePDF.SaveToFile("facturx_document.pdf")
    fs.Close()
    fs.Dispose()
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
    gdpicturePDF.LoadFromFile("pdfa3.pdf", true);
    FileStream fs = new FileStream("factur-x.xml", FileMode.Open);
    gdpicturePDF.EmbedInvoiceData(fs, PdfInvoiceDataFormat.FacturX_1_0);
    gdpicturePDF.SaveToFile("facturx_document.pdf");
    fs.Close();
    fs.Dispose();
}
See Also