DynaPDF.GetPageField
--------------------

Returns the most important properties of a field on a page.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [13.0](newinversion130.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.GetPageField"; PDF; Field; Selector ) 

**MBS**( **"DynaPDF.GetPageField";** /\* Returns the most important properties of a field on a page. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Field**; /\* The field index within the page.  
Zero based and up to [DynaPDF.GetPageFieldCount](DynaPDFGetPageFieldCount.md)-1.e.g. $index \*/   
**$Selector**) /\* What value to query.   
Can be Deleted, BBox, FieldType, GroupType, Handle, BackColor, BackColorSP, BorderColor, BorderColorSP, BorderStyle, BorderWidth, CharSpacing, Checked, CheckBoxChar, DefState, DefValue, EditFont, ExpValueCount, BorderColor, FieldFlags, FieldFont, FontSize, FieldName, HighlightMode, IsCalcField, MapName, MaxLen, KidCount, PageNum, Rotate, TextAlign, TextColor, TextColorSP, TextScaling, ToolTip, UniqueName, Value, WordSpacing, Parent or Kids.  
  
Added ModDate, CaptionPos, DownCaption, DownImage, RollCaption, RollImage, UpCaption, UpImage, Action and ActionType for version 9.0.e.g. "Name" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Field | The field index within the page.   Zero based and up to [DynaPDF.GetPageFieldCount](DynaPDFGetPageFieldCount.md)-1. | $index |
| Selector | What value to query.    Can be Deleted, BBox, FieldType, GroupType, Handle, BackColor, BackColorSP, BorderColor, BorderColorSP, BorderStyle, BorderWidth, CharSpacing, Checked, CheckBoxChar, DefState, DefValue, EditFont, ExpValueCount, BorderColor, FieldFlags, FieldFont, FontSize, FieldName, HighlightMode, IsCalcField, MapName, MaxLen, KidCount, PageNum, Rotate, TextAlign, TextColor, TextColorSP, TextScaling, ToolTip, UniqueName, Value, WordSpacing, Parent or Kids.      Added ModDate, CaptionPos, DownCaption, DownImage, RollCaption, RollImage, UpCaption, UpImage, Action and ActionType for version 9.0. | "Name" |

### Result

Returns OK or error.

### Description

Returns the most important properties of a field on a page.   
You need to call [DynaPDF.EditPage](DynaPDFEditPage.md) before to open a page.  
See also [GetPageField](https://www.monkeybreadsoftware.com/DynaPDF-Manual/GetPageField.shtml) function in DynaPDF manual.

### Examples

Sets a text field and flatterns it

 # Gets passed PDF number, field name, value and an action (Flatten or empty)   
\#   
\# Get variables   
Set Variable \[ $pdf ; Value: GetValue ( Get ( ScriptParameter ) ; 1 ) \]   
Set Variable \[ $fieldname ; Value: GetValue ( Get ( ScriptParameter ) ; 2 ) \]   
Set Variable \[ $value ; Value: GetValue ( Get ( ScriptParameter ) ; 3 ) \]   
Set Variable \[ $action ; Value: GetValue ( Get ( ScriptParameter ) ; 4 ) \]   
\#   
\# Set text for the field   
Set Variable \[ $SetError ; Value: MBS ( "[DynaPDF.SetTextFieldValueEx](DynaPDFSetTextFieldValueEx.md)" ; $pdf ; $fieldname ; $value ) \]   
If \[ $action = "Flatten" \]   
 # query, which page the field is on, so we can edit that page, required for drawing  
 Set Variable \[ $page ; Value: MBS ( "[DynaPDF.GetField](DynaPDFGetField.md)"; $pdf ; $fieldname ; "page") \]   
 If \[ $page &gt; 0 \]   
 Set Variable \[ $EditError ; Value: MBS ( "[DynaPDF.EditPage](DynaPDFEditPage.md)"; $pdf ; $page ) \]   
 If \[ $EditError = "OK" \]   
 # We loop over the fields on the page to find the right one  
 Set Variable \[ $PageFieldCount ; Value: MBS ( "[DynaPDF.GetPageFieldCount](DynaPDFGetPageFieldCount.md)"; $pdf ) \]   
 Set Variable \[ $PageFieldIndex ; Value: 0 \]   
 Set Variable \[ $found ; Value: 0 \]   
 If \[ $PageFieldIndex &lt; $PageFieldCount \]   
 Loop  
 # check name  
 Set Variable \[ $Name ; Value: MBS ( "DynaPDF.GetPageField"; $pdf ; $PageFieldIndex ; "name" ) \]   
 If \[ $Name = $fieldname \]   
 # found the field to flatten  
 Set Variable \[ $FlattenError ; Value: MBS ("[DynaPDF.FlattenAnnotOrField](DynaPDFFlattenAnnotOrField.md)"; $pdf ; $PageFieldIndex ) \]   
 Set Variable \[ $found ; Value: 1 \]   
 Exit Loop If \[ 1 \]   
 End If  
 #   
 # next  
 Set Variable \[ $PageFieldIndex ; Value: $PageFieldIndex + 1 \]   
 Exit Loop If \[ $PageFieldIndex ≥ $PageFieldCount \]   
 End Loop  
 End If  
 Set Variable \[ $r ; Value: MBS ( "[DynaPDF.EndPage](DynaPDFEndPage.md)"; $PDF ; $page ) \]   
 If \[ not $found \]   
 Exit Script \[ Text Result: "Field not found!" \]   
 Else  
 Exit Script \[ Text Result: $FlattenError \]   
 End If  
 Else  
 Exit Script \[ Text Result: $EditError \]   
 End If  
 End If  
End If  
Exit Script \[ Text Result: $SetError \]  
### See also

- [DynaPDF.GetField](DynaPDFGetField.md)
- [DynaPDF.GetFieldExpValue](DynaPDFGetFieldExpValue.md)
- [DynaPDF.GetPageBBox](DynaPDFGetPageBBox.md)
- [DynaPDF.GetPageCoords](DynaPDFGetPageCoords.md)
- [DynaPDF.GetPageCount](DynaPDFGetPageCount.md)
- [DynaPDF.GetPageFieldCount](DynaPDFGetPageFieldCount.md)
- [DynaPDF.GetPageLabel](DynaPDFGetPageLabel.md)
- [DynaPDF.GetPageMode](DynaPDFGetPageMode.md)
- [DynaPDF.GetPageNum](DynaPDFGetPageNum.md)
- [DynaPDF.SetTextFieldValueEx](DynaPDFSetTextFieldValueEx.md)

### Release notes

- **Version 13.0**
    - Added [DynaPDF.GetPageField](https://www.mbsplugins.eu/DynaPDFGetPageField.shtml) and [DynaPDF.GetPageFieldAnnotation](https://www.mbsplugins.eu/DynaPDFGetPageFieldAnnotation.shtml) functions.

### Blog Entries

- [New in MBS FileMaker Plugin 13.0](https://www.mbsplugins.de/archive/2023-01-24/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.6pr1](https://www.mbsplugins.de/archive/2022-12-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th November 2022 , last changed 18th November 2022

  
[DynaPDF.GetPageCount](DynaPDFGetPageCount.md) - [DynaPDF.GetPageFieldAnnotation](DynaPDFGetPageFieldAnnotation.md)

[HTML Version](DynaPDFGetPageField.shtml)