DynaPDF.SetBBox
---------------

Sets a specific bounding box of the current open PDF page.

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

MBS( "DynaPDF.SetBBox"; PDF; Box; Left; Top; Right; Bottom ) 

**MBS**( **"DynaPDF.SetBBox";** /\* Sets a specific bounding box of the current open PDF page. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Box**; /\* Which box to set. Can be Art, Bleed, Crop, Trim or Media.e.g. "Media" \*/   
**$Left**; /\* The lower left x value.e.g. 0 \*/   
**$Top**; /\* The lower left y.e.g. 0 \*/   
**$Right**; /\* The upper right x.e.g. 595 \*/   
**$Bottom**) /\* The upper right y.e.g. 842 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Box | Which box to set. Can be Art, Bleed, Crop, Trim or Media. | "Media" |
| Left | The lower left x value. | 0 |
| Top | The lower left y. | 0 |
| Right | The upper right x. | 595 |
| Bottom | The upper right y. | 842 |

### Result

Returns OK or error.

### Description

Sets a specific bounding box of the current open PDF page.   
A PDF page may be prepared either for a finished medium, such as a sheet of paper, or as part of a prepress process in which the content of the page is placed on an intermediate medium, such as film or an imposed reproduction plate.  
See also SetBBox function in dynapdf\_help.pdf.  
See also [SetBBox](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetBBox.shtml) function in DynaPDF manual.

### Examples

Set a media and trim box with same size:

 Set Variable \[ $r ; Value: MBS ("DynaPDF.SetBBox"; $pdf ; "Media"; 0; 0; MBS ("[DynaPDF.GetPageWidth](DynaPDFGetPageWidth.md)"; $pdf ); MBS ("[DynaPDF.GetPageHeight](DynaPDFGetPageHeight.md)"; $pdf )) \]  
Set Variable \[ $r ; Value: MBS ("DynaPDF.SetBBox"; $pdf ; "Trim"; 0; 0; MBS ("[DynaPDF.GetPageWidth](DynaPDFGetPageWidth.md)"; $pdf ); MBS ("[DynaPDF.GetPageHeight](DynaPDFGetPageHeight.md)"; $pdf )) \]  
Set A4 page size:

 Set Variable \[ $r ; Value: MBS ("DynaPDF.SetBBox"; $pdf ; "Media"; 0; 0; 595; 842) \]  
Set A5 page size with top part of an A4 page:

 Set Variable \[ $r ; Value: MBS ("DynaPDF.SetBBox"; $pdf ; "Media"; 0; 421; 595; 842) \]  
### See also

- [DynaPDF.GetBBox](DynaPDFGetBBox.md)
- [DynaPDF.GetPageHeight](DynaPDFGetPageHeight.md)
- [DynaPDF.GetPageWidth](DynaPDFGetPageWidth.md)
- [DynaPDF.GetUseVisibleCoords](DynaPDFGetUseVisibleCoords.md)
- [DynaPDF.RenderPage](DynaPDFRenderPage.md)
- [DynaPDF.SetFont](DynaPDFSetFont.md)
- [DynaPDF.SetPageBBox](DynaPDFSetPageBBox.md)
- [DynaPDF.SetPageHeight](DynaPDFSetPageHeight.md)
- [DynaPDF.SetPageWidth](DynaPDFSetPageWidth.md)
- [DynaPDF.SetUseVisibleCoords](DynaPDFSetUseVisibleCoords.md)

### Example Databases

- [DynaPDF/Convert to 2 Pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Convert%20to%202%20Pages.shtml#4ScriptAnchor_)
- [DynaPDF/Create Text as PDFA](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Create%20Text%20as%20PDFA.shtml#6ScriptAnchor_)
- [DynaPDF/List Annotations](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/List%20Annotations.shtml#2ScriptAnchor_)
- [DynaPDF/PDF Crop](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/PDF%20Crop.shtml#2ScriptAnchor_)
- [DynaPDF/Place Picture](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Place%20Picture.shtml#1ScriptAnchor_)
- [DynaPDF/Render Page](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Render%20Page.shtml#4ScriptAnchor_)
- [DynaPDF/Shrink PDF pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Shrink%20PDF%20pages.shtml#2ScriptAnchor_)

### Blog Entries

- [Using DynaPDF with Data API for PDF generation](https://www.mbsplugins.de/archive/2026-05-25/Using_DynaPDF_with_Data_API_fo/monkeybreadsoftware_blog_filemaker)
- [Draw images with text using DynaPDF](https://www.mbsplugins.de/archive/2026-01-03/Draw_images_with_text_using_Dy/monkeybreadsoftware_blog_filemaker)
- [Adding cutting lines for PDF in FileMaker](https://www.mbsplugins.de/archive/2021-01-04/Adding_cutting_lines_for_PDF_i/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.5pr2](https://www.mbsplugins.de/archive/2014-12-01/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.0pr1](https://www.mbsplugins.de/archive/2014-01-03/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 11st April 2026

  
[DynaPDF.SetAnnotSubject](DynaPDFSetAnnotSubject.md) - [DynaPDF.SetBidiMode](DynaPDFSetBidiMode.md)

[HTML Version](DynaPDFSetBBox.shtml)