# Set-OfficePdfForm

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

Project

PSWriteOffice

PowerShell document automation across OfficeIMO's document, spreadsheet, presentation, PDF, Project, Access, EPUB, invoicing, and conversion engines.

[View on GitHub](https://github.com/EvotecIT/OfficeIMO/tree/master/PowerShell/PSWriteOffice) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteOffice/releases/tag/v3.0.5) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteOffice/0.2.0)

Stars **725**

Forks **84**

Open issues **3**

Total downloads **5,231,343**

Release **OfficeIMO-v3.6.2**

Language: C# Updated: 2026-11-23

Cmdlet 

**Module**

`PSWriteOffice`

**Inputs**

`None`

**Outputs**

`System.IO.FileInfo`

**Source**

[SetOfficePdfFormCommand.cs:24](https://github.com/EvotecIT/PSWriteOffice/blob/main/Sources/PSWriteOffice/Cmdlets/Pdf/SetOfficePdfFormCommand.cs#L24) 

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

## Syntax

```
Set-OfficePdfForm
[-AppearanceFontFamilyName <String>]
[-AppearanceFontPath <String>]
[-Field <Hashtable>]
[-Flatten]
[-IgnorePermissionRestrictions]
[-Incremental]
[-KeepNeedAppearances]
-OutputPath <String>
[-PassThru]
[-Password <String>]
-Path <String>
[<CommonParameters>]
```

[#](#method-set-officepdfform-string-string-hashtable-switchparameter-switchparameter-switchparameter-switchparameter-string-switchparameter-string-string)

Parameter set: `All Parameter Sets`

## Examples

### Fill and flatten a PDF form.

```powershell
$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.

## Parameters

**-AppearanceFontFamilyName String optional**

PDF font family name used for the supplied appearance font.

**-AppearanceFontPath String optional**

TrueType or OpenType/CFF font file used to synthesize Unicode form field appearances.

**-Field Hashtable optional**

Field values keyed by form field name.

**-Flatten SwitchParameter optional**

Flatten simple form fields after filling, or flatten without filling when -Field is omitted.

**-IgnorePermissionRestrictions SwitchParameter optional**

After successful password authentication, explicitly ignore owner-imposed form-modification restrictions.

**-Incremental SwitchParameter optional**

Append simple form field values as an incremental PDF revision instead of rewriting the existing PDF.

**-KeepNeedAppearances SwitchParameter optional**

True to keep /NeedAppearances enabled for legacy PDF viewers after filling fields.

**-OutputPath String required**

Output PDF path.

**-PassThru SwitchParameter optional**

Emit the object created or changed by the command.

**-Password String optional**

Password used to authenticate an encrypted PDF.

**-Path String requiredaliases: FilePath**

Input PDF path.

## 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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:2765A1DBF63403FCD5B8E58B8B3B97B0FDD3847353A1C5EFF0D9D93E8C3A9E18 -->
