API Reference

Cmdlet

Set-OfficePdfForm

Namespace PSWriteOffice
Inputs
None
Outputs
System.IO.FileInfo

Fills and optionally flattens simple AcroForm fields in an existing PDF.

Remarks

Fills and optionally flattens simple AcroForm fields in an existing PDF.

Examples

Authored help example

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 Sets

Parameters

AppearanceFontFamilyName String optionalposition: namedpipeline: False
PDF font family name used for the supplied appearance font.
AppearanceFontPath String optionalposition: namedpipeline: False
TrueType or OpenType/CFF font file used to synthesize Unicode form field appearances.
Field Hashtable optionalposition: namedpipeline: False
Field values keyed by form field name.
Flatten SwitchParameter optionalposition: namedpipeline: False
Flatten simple form fields after filling, or flatten without filling when -Field is omitted.
Incremental SwitchParameter optionalposition: namedpipeline: False
Append simple form field values as an incremental PDF revision instead of rewriting the existing PDF.
KeepNeedAppearances SwitchParameter optionalposition: namedpipeline: False
True to keep /NeedAppearances enabled for legacy PDF viewers after filling fields.
OutputPath String requiredposition: namedpipeline: False
Output PDF path.
Path String requiredposition: namedpipeline: Falsealiases: FilePath
Input PDF path.

Outputs

System.IO.FileInfo