Cmdlet
Add-OfficePdfFormField
Adds a simple AcroForm field to a generated PDF document.
Syntax
Add-OfficePdfFormField
[-Alignment <OfficeAlignment>]
[-Checked]
[-CheckedValue <String>]
[-Height <OfficeLength>]
[-ListBox]
[-Name] <String>
[-Option <String[]>]
[-Size <OfficeLength>]
[-Type <Text| CheckBox| Choice| MultiSelectChoice| RadioButton>]
[-Value <String[]>]
[-Width <OfficeLength>]
[<CommonParameters>]#Parameter set:
ContextAdd-OfficePdfFormField
[-Alignment <OfficeAlignment>]
[-Checked]
[-CheckedValue <String>]
-Document <PdfDocument>
[-Height <OfficeLength>]
[-ListBox]
[-Name] <String>
[-Option <String[]>]
[-PassThru]
[-Size <OfficeLength>]
[-Type <Text| CheckBox| Choice| MultiSelectChoice| RadioButton>]
[-Value <String[]>]
[-Width <OfficeLength>]
[<CommonParameters>]#Parameter set:
DocumentExamples
Create a simple PDF form.
New-OfficePdf -Path .\Examples\Documents\PdfForm.pdf {
Add-OfficePdfHeading -Text 'Access request'
Add-OfficePdfParagraph -Text 'Requester'
Add-OfficePdfFormField -Name 'Requester' -Type Text -Width 240
Add-OfficePdfParagraph -Text 'Priority'
Add-OfficePdfFormField -Name 'Priority' -Type Choice -Option 'Low','Normal','High' -Value 'Normal'
Add-OfficePdfFormField -Name 'Approved' -Type CheckBox
}Adds text, choice, and checkbox form fields to a generated PDF.
Parameters
- -Alignment OfficeAlignment
- Field alignment.
- Possible values:
Left,Center,Right,Justify,Start,End - -Checked SwitchParameter
- Initial check-box state.
- -CheckedValue String
- Export name of the checked state for a check box.
- -Height OfficeLength
- Rendered field height in PDF points.
- -ListBox SwitchParameter
- Render scalar choices as a list box rather than a combo box.
- -Name String
- Form field name.
- -Option String[]
- Choice or radio options.
- -Size OfficeLength
- Native field text size or check-box size.
- -Type OfficePdfFormFieldType
- Field type to add.
- Possible values:
Text,CheckBox,Choice,MultiSelectChoice,RadioButton - -Value String[]
- Initial value; MultiSelectChoice accepts multiple selected values, other fields accept at most one.
- -Width OfficeLength
- Rendered field width in PDF points.
- -Document PdfDocument
- PDF document to update outside the DSL context.
- -PassThru SwitchParameter
- Emit the updated document.
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.