DynaPDF.EditPage
----------------

This function prepares a page for editing.

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

MBS( "DynaPDF.EditPage"; PDF; Page ) 

**MBS**( **"DynaPDF.EditPage";** /\* This function prepares a page for editing. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Page**) /\* The number of the page to edit. Range from 1 to [DynaPDF.GetPageCount](DynaPDFGetPageCount.md).e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Page | The number of the page to edit. Range from 1 to [DynaPDF.GetPageCount](DynaPDFGetPageCount.md). | 1 |

### Result

Returns OK on success.

### Description

This function prepares a page for editing.  
If the page does exist (PageNum is greater than the number of pages in the document), new pages are appended until the number of pages is equal PageNum. An open page must be closed with EndPage() after the required changes are made.  
See also [EditPage](https://www.monkeybreadsoftware.com/DynaPDF-Manual/EditPage.shtml) function in DynaPDF manual.

### Examples

Edit page 1:

 Set Variable \[$r ; Value:MBS ("DynaPDF.EditPage"; $pdf ; 1)\]  
Loop over pages and add page numbers:

 Set Variable \[$PageCount ; Value:MBS ( "[DynaPDF.GetPageCount](DynaPDFGetPageCount.md)"; $pdf )\]  
Set Variable \[$PageNumber ; Value:1\]  
Set Variable \[$pageWidth ; Value:MBS ("[DynaPDF.GetPageWidth](DynaPDFGetPageWidth.md)"; $pdf )\]  
Set Variable \[$pageHeight ; Value:MBS ("[DynaPDF.GetPageHeight](DynaPDFGetPageHeight.md)"; $pdf )\]  
Loop  
 Set Variable \[$r ; Value:MBS ("DynaPDF.EditPage"; $pdf ; $PageNumber )\]  
 Set Variable \[$r ; Value:MBS ( "[DynaPDF.SetFont](DynaPDFSetFont.md)"; $pdf ; "Helvetica"; 0; 12)\]  
 Set Variable \[$r ; Value:MBS ( "[DynaPDF.WriteFTextEx](DynaPDFWriteFTextEx.md)"; $pdf ; 50; $pageHeight - 50; $pageWidth -100; 30; "right"; GetAsText($PageNumber ) &amp; " of " &amp; $PageCount )\]  
 Set Variable \[$r ; Value:MBS ("[DynaPDF.EndPage](DynaPDFEndPage.md)"; $pdf )\]  
 Set Variable \[$PageNumber ; Value:$PageNumber +1\]  
 Exit Loop If \[$PageNumber &gt; $PageCount \]  
End Loop  
### See also

- [DynaPDF.EndPage](DynaPDFEndPage.md)
- [DynaPDF.MovePage](DynaPDFMovePage.md)
- [DynaPDF.PageLinkEx](DynaPDFPageLinkEx.md)
- [DynaPDF.PlaceTemplate](DynaPDFPlaceTemplate.md)
- [DynaPDF.ReplacePattern](DynaPDFReplacePattern.md)
- [DynaPDF.RotateCoords](DynaPDFRotateCoords.md)
- [DynaPDF.SetFieldBorderColor](DynaPDFSetFieldBorderColor.md)
- [DynaPDF.SetOrientationEx](DynaPDFSetOrientationEx.md)
- [DynaPDF.WebLink](DynaPDFWebLink.md)
- [DynaPDF.WriteFText](DynaPDFWriteFText.md)

### Example Databases

- [Barcode/QRCode PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Barcode/QRCode%20PDF.shtml#2ScriptAnchor_)
- [DynaPDF/Add Page Links](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Add%20Page%20Links.shtml#2ScriptAnchor_)
- [DynaPDF/Add Page Numbers](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Add%20Page%20Numbers.shtml#2ScriptAnchor_)
- [DynaPDF/Book Creation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Book%20Creation.shtml#3ScriptAnchor_)
- [DynaPDF/Highlight Text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Highlight%20Text.shtml#2ScriptAnchor_)
- [DynaPDF/List Annotations](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/List%20Annotations.shtml#2ScriptAnchor_)
- [DynaPDF/Merge PDFs](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Merge%20PDFs.shtml#5ScriptAnchor_)
- [DynaPDF/PDF Crop](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/PDF%20Crop.shtml#2ScriptAnchor_)
- [DynaPDF/Shrink PDF pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Shrink%20PDF%20pages.shtml#3ScriptAnchor_)
- [DynaPDF/Watermark pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Watermark%20pages.shtml#2ScriptAnchor_)

### Blog Entries

- [Make PDF certificates in calculation with DynaPDF](https://www.mbsplugins.de/archive/2026-05-18/Make_PDF_certificates_in_calcu/monkeybreadsoftware_blog_filemaker)
- [Retract text from a PDF with DynaPDF](https://www.mbsplugins.de/archive/2025-11-01/Retract_text_from_a_PDF_with_D/monkeybreadsoftware_blog_filemaker)
- [How the Script Merges PDFs and Inserts an Image: A Detailed Breakdown](https://www.mbsplugins.de/archive/2025-02-16/How_the_Script_Merges_PDFs_and/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Advent calendar - Door 6 - Sending Out Wishlist Forms](https://www.mbsplugins.de/archive/2024-12-06/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [Unlocking the Power of PDFs in FileMaker with DynaPDF and the MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2024-09-16/Unlocking_the_Power_of_PDFs_in/monkeybreadsoftware_blog_filemaker)
- [PDF Attachments in FileMaker with DynaPDF](https://www.mbsplugins.de/archive/2024-01-29/PDF_Attachments_in_FileMaker_w/monkeybreadsoftware_blog_filemaker)
- [MBS Plugin Advent calendar: 15 - DynaPDF](https://www.mbsplugins.de/archive/2023-12-15/MBS_Plugin_Advent_calendar_15_/monkeybreadsoftware_blog_filemaker)
- [Add page links for FileMaker](https://www.mbsplugins.de/archive/2022-06-18/Add_page_links_for_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Things you can do with DynaPDF](https://www.mbsplugins.de/archive/2021-07-02/Things_you_can_do_with_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [Swiss QR-Codes for invoices as vector graphics](https://www.mbsplugins.de/archive/2020-06-12/Swiss_QR-Codes_for_invoices_as/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2022, Seite 19](https://filemaker-magazin.de/neuigkeit/4172-Appetithappen-FMM_202201)
- [Ausgabe 6/2020, Seite 35](https://filemaker-magazin.de/neuigkeit/4118-Appetithappen-FMM_202006)
- [Ausgabe 3/2019, Seite 37](https://filemaker-magazin.de/neuigkeit/4046-Appetithappen-FMM_201903)
- [Ausgabe 2/2019, Seite 27](https://filemaker-magazin.de/neuigkeit/4043-Appetithappen-FMM_201902)

This function checks for a license.

Created 18th August 2014 , last changed 18th June 2016

  
[DynaPDF.DrawPie](DynaPDFDrawPie.md) - [DynaPDF.EditTemplate](DynaPDFEditTemplate.md)

[HTML Version](DynaPDFEditPage.shtml)