API Reference

Cmdlet

Add-OfficePdfFormField

Aliases: PdfFormField
Namespace PSWriteOffice
Aliases
PdfFormField
Inputs
OfficeIMO.Pdf.PdfDocument
Outputs
OfficeIMO.Pdf.PdfDocument

Adds a simple AcroForm field to a generated PDF document.

Remarks

Adds a simple AcroForm field to a generated PDF document.

Examples

Authored help example

Create a simple PDF form.

PS>


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 -Options 'Low','Normal','High' -Value 'Normal'
                Add-OfficePdfFormField -Name 'Approved' -Type CheckBox
              }
        

Adds text, choice, and checkbox form fields to a generated 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

Add-OfficePdfFormField [-Align <Left|Center|Right|Justify>] [-Checked] [-Height <Double>] -Name <String> [-Options <String[]>] [-PassThru] [-Type <Text|CheckBox|Choice|MultiSelectChoice|RadioButton>] [-Value <String>] [-Values <String[]>] [-Width <Double>] [<CommonParameters>]
#
Parameter set: Context

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Field alignment.
Possible values: Left, Center, Right, Justify
Checked SwitchParameter optionalposition: namedpipeline: False
Initial check-box state.
Height Double optionalposition: namedpipeline: False
Rendered field height in PDF points.
Name String requiredposition: 0pipeline: False
Form field name.
Options String[] optionalposition: namedpipeline: False
Choice or radio options.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Type OfficePdfFormFieldType optionalposition: namedpipeline: Falsevalues: 5
Field type to add.
Possible values: Text, CheckBox, Choice, MultiSelectChoice, RadioButton
Value String optionalposition: namedpipeline: False
Initial text, selected choice, or selected radio value.
Values String[] optionalposition: namedpipeline: False
Initial selected values for multi-select choice fields.
Width Double optionalposition: namedpipeline: False
Rendered field width in PDF points.

Outputs

OfficeIMO.Pdf.PdfDocument

Add-OfficePdfFormField [-Align <Left|Center|Right|Justify>] [-Checked] -Document <PdfDocument> [-Height <Double>] -Name <String> [-Options <String[]>] [-PassThru] [-Type <Text|CheckBox|Choice|MultiSelectChoice|RadioButton>] [-Value <String>] [-Values <String[]>] [-Width <Double>] [<CommonParameters>]
#
Parameter set: Document

Parameters

Align PdfAlign optionalposition: namedpipeline: Falsevalues: 4
Field alignment.
Possible values: Left, Center, Right, Justify
Checked SwitchParameter optionalposition: namedpipeline: False
Initial check-box state.
Document PdfDocument requiredposition: namedpipeline: True (ByValue)
PDF document to update outside the DSL context.
Height Double optionalposition: namedpipeline: False
Rendered field height in PDF points.
Name String requiredposition: 0pipeline: False
Form field name.
Options String[] optionalposition: namedpipeline: False
Choice or radio options.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit the updated document.
Type OfficePdfFormFieldType optionalposition: namedpipeline: Falsevalues: 5
Field type to add.
Possible values: Text, CheckBox, Choice, MultiSelectChoice, RadioButton
Value String optionalposition: namedpipeline: False
Initial text, selected choice, or selected radio value.
Values String[] optionalposition: namedpipeline: False
Initial selected values for multi-select choice fields.
Width Double optionalposition: namedpipeline: False
Rendered field width in PDF points.

Outputs

OfficeIMO.Pdf.PdfDocument