AutoFiller
Overview
AutoFiller is a class in Aspose.PDF FOSS for .NET.
Inherits from: ISaveableFacade, IDisposable.
Repeatedly stamps a template PDF with rows from a DataTable: for each row, fills the form fields whose names match column names, flattens (except those listed in UnFlattenFields), and appends the resulting pages to the output.
This class declares 10 methods for AutoFiller objects in .NET programs.
Available methods include: AutoFiller, BindPdf, Close, Dispose, ImportDataTable, Save.
Public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: BasicFileName, GeneratingPath, InputFileName, InputStream, OutputFileName, OutputStream, and 2 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
InputFileName | string? | Read/Write | Path to the template PDF (set this OR call BindPdf(string)). |
OutputFileName | string? | Read/Write | Path where Save() writes the merged result. |
InputStream | Stream? | Read/Write | Stream form of InputFileName — when set, used in preference to the file path. |
OutputStream | Stream? | Read/Write | Stream form of OutputFileName — when set, Save() writes here. |
GeneratingPath | string? | Read/Write | Directory used for per-row PDF generation when batch-saving by row to separate files. |
BasicFileName | string? | Read/Write | Base name used for per-row PDF generation in batch mode. |
UnFlattenFields | string[] | Read/Write | Field names to leave editable (i.e. |
OutputStreams | Stream[]? | Read/Write | Output streams used by batch-mode save (per-row). |
Methods
| Signature | Description |
|---|---|
AutoFiller() | Create an unbound AutoFiller. |
BindPdf(srcDoc: Document) | Uses an already opened document as the template. |
BindPdf(srcFile: string) | Opens the PDF file at the given path and uses it as the template. |
BindPdf(srcStream: Stream) | Reads the whole stream (from the start when it is seekable) and uses that PDF as the template. |
ImportDataTable(dataTable: DataTable) | For each row in table, clone the template, set form-field values from row[columnName], flatten (except UnFlattenFields), and append the cloned pages to the output document. |
Save() | Save the merged output. |
Save(destFile: string) | Saves the merged output document to the given file path. |
Save(destStream: Stream) | Saves the merged output document to the given stream. |
Close() | Releases the template and the output document; same as Dispose. |
Dispose() | Calls Dispose on this AutoFiller instance. |