Gets a collection of
StoredStream objects that
represent packets of XFA data contained within a PDF Document. Each StoredStream will contain XML data that
represents the XFA data. XFA may be contained within a single stream or within a collection of packets, each of
which represents a subsection of the XFA model.
Namespace:
Atalasoft.PdfDoc.Generating.Forms
Assembly:
Atalasoft.PdfDoc (in Atalasoft.PdfDoc.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax public IList<StoredStream> XFA { get; }
Public ReadOnly Property XFA As IList(Of StoredStream)
Get
Property Value
Type:
IListStoredStreamRemarks
DotPdf makes no guarantees about the correctness of the data contained within the XFA packets nor will
DotPdf make any attempt to validate data that is provided by client code or other sources before writing
the streams to the file.
Note that if the source document is signed, saving the new document will generate an exception. See
DocumentWasSigned
for more information.
Examples
PdfGeneratedDocument doc = new PdfGeneratedDocument("myform.pdf");
if (doc.Form == null) return;
foreach (StoredStream sstm in doc.Form.XFA) {
ProcessXFAPacket(sstm.Aquire());
sstm.Release();
}
PdfGenerateDocument changedoc = new PdfGeneratedDocument("myform.pdf");
if (doc.Form == null return;
if (doc.DocumentWasSigned) return; // can't reliably edit a signed document
TempFileStreamProvider provider = new TempFileStreamProvider();
StoredStream sstm = provider.MakeStream();
Stream stm = sstm.Aquire();
CopyNewXFAPacketToStream(stm);
sstm.Release();
doc.Form.XFA.Add(sstm);
doc.Save("newdataadded.pdf");
See Also