DynaPDF.ExtractPageRectText
---------------------------

Extracts the text of the page in a rectangle.

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

### Deprecated

This function was [deprecated](deprecated.md). Use [DynaPDF.ExtractText](DynaPDFExtractText.md) instead.

MBS( "DynaPDF.ExtractPageRectText"; PDF; PageIndex; RectLeft; RectTop; RectRight; RectBottom ) 

**MBS**( **"DynaPDF.ExtractPageRectText";** /\* Extracts the text of the page in a rectangle. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$PageIndex**; /\* The number of the page. Must be within 1 and [DynaPDF.GetPageCount](DynaPDFGetPageCount.md).e.g. 1 \*/   
**$RectLeft**; /\* Left coordinate of the rectangle to search.e.g. 0 \*/   
**$RectTop**; /\* Top coordinate of the rectangle to search.e.g. 0 \*/   
**$RectRight**; /\* Right coordinate of the rectangle to search.e.g. 595 \*/   
**$RectBottom**) /\* Bottom coordinate of the rectangle to search.e.g. 842 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| PageIndex | The number of the page. Must be within 1 and [DynaPDF.GetPageCount](DynaPDFGetPageCount.md). | 1 |
| RectLeft | Left coordinate of the rectangle to search. | 0 |
| RectTop | Top coordinate of the rectangle to search. | 0 |
| RectRight | Right coordinate of the rectangle to search. | 595 |
| RectBottom | Bottom coordinate of the rectangle to search. | 842 |

### Result

Returns the text or error message.

### Description

Extracts the text of the page in a rectangle.  
Use [DynaPDF.ExtractPageText](DynaPDFExtractPageText.md) is you need text from whole page.  
Text that starts within the given rectangle is captured.  
Be aware that PDF coordinates start on bottom left of page with 0/0.  
Needs DynaPDF Lite license.  
  
If you have an open page, we close it automatically for you before doing the import.  
### Examples

Takes text only from top rectangle:

 MBS ("DynaPDF.ExtractPageRectText"; $pdf ; $PageIndex ; 0; 695; 595; 842)  
Takes text only from left column:

 MBS ("DynaPDF.ExtractPageRectText"; $pdf ; $PageIndex ; 0; 0; 295; 842)  
Takes text only from right column:

 MBS ("DynaPDF.ExtractPageRectText"; $pdf ; $PageIndex ; 295; 0; 595; 842)  
### See also

- [DynaPDF.ExtractDocumentText](DynaPDFExtractDocumentText.md)
- [DynaPDF.ExtractPageText](DynaPDFExtractPageText.md)
- [DynaPDF.GetPageCount](DynaPDFGetPageCount.md)
- [DynaPDF.New](DynaPDFNew.md)
- [OCR.SetImage](OCRSetImage.md)

### Release notes

- **Version 13.0**
    - Deprecated [DynaPDF.ExtractPageRectText](https://www.mbsplugins.eu/DynaPDFExtractPageRectText.shtml) and [DynaPDF.ExtractPageText](https://www.mbsplugins.eu/DynaPDFExtractPageText.shtml) functions in favor of [DynaPDF.ExtractText](https://www.mbsplugins.eu/DynaPDFExtractText.shtml) function.
- **Version 10.1**
    - Fixed a problem with recursive templates in [DynaPDF.ExtractDocumentText](https://www.mbsplugins.eu/DynaPDFExtractDocumentText.shtml), [DynaPDF.ExtractPageRectText](https://www.mbsplugins.eu/DynaPDFExtractPageRectText.shtml) and [DynaPDF.ExtractPageText](https://www.mbsplugins.eu/DynaPDFExtractPageText.shtml) functions.

### Blog Entries

- [MBS FileMaker Plugin, version 12.6pr1](https://www.mbsplugins.de/archive/2022-12-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.1pr5](https://www.mbsplugins.de/archive/2020-02-24/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 6.2 for OS X/Windows](https://www.mbsplugins.de/archive/2016-05-24/MBS_FileMaker_Plugin_62_for_OS/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.2pr7](https://www.mbsplugins.de/archive/2016-05-07/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 30th April 2016 , last changed 25th September 2024

  
[DynaPDF.ExtractImages](DynaPDFExtractImages.md) - [DynaPDF.ExtractPageText](DynaPDFExtractPageText.md)

[HTML Version](DynaPDFExtractPageRectText.shtml)