API Reference
Cmdlet
Set-OfficePdfForm
Fills and optionally flattens simple AcroForm fields in an existing PDF.
Remarks
Fills and optionally flattens simple AcroForm fields in an existing PDF.
Examples
Fill and flatten a PDF form.
PS>
$fields = @{
Requester = 'Ada Lovelace'
Priority = 'High'
Approved = $true
}
Set-OfficePdfForm -Path .\Examples\Documents\Request.pdf -OutputPath .\Examples\Documents\Request-FilledFlat.pdf -Field $fields -Flatten
Fills simple AcroForm fields and writes a flattened PDF.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Set-OfficePdfForm [-AppearanceFontFamilyName <String>] [-AppearanceFontPath <String>] [-Field <Hashtable>] [-Flatten] [-Incremental] [-KeepNeedAppearances] -OutputPath <String> -Path <String> [<CommonParameters>]#Parameter set:
All Parameter SetsParameters
- AppearanceFontFamilyName String
- PDF font family name used for the supplied appearance font.
- AppearanceFontPath String
- TrueType or OpenType/CFF font file used to synthesize Unicode form field appearances.
- Field Hashtable
- Field values keyed by form field name.
- Flatten SwitchParameter
- Flatten simple form fields after filling, or flatten without filling when -Field is omitted.
- Incremental SwitchParameter
- Append simple form field values as an incremental PDF revision instead of rewriting the existing PDF.
- KeepNeedAppearances SwitchParameter
- True to keep /NeedAppearances enabled for legacy PDF viewers after filling fields.
- OutputPath String
- Output PDF path.
- Path String
- Input PDF path.
Outputs
System.IO.FileInfo