DynaPDF.SetPageWidth
--------------------

Sets page width.

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

MBS( "DynaPDF.SetPageWidth"; PDF; Width ) 

**MBS**( **"DynaPDF.SetPageWidth";** /\* Sets page width. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Width**) /\* The new page width.e.g. 800 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Width | The new page width. | 800 |

### Result

Returns OK on success or error.

### Description

Sets page width.  
The function changes the width of the currently open page if any, or the default width for newly created pages. This function changes the media box of a page (see also [DynaPDF.SetBBox](DynaPDFSetBBox.md)). The page width must be greater zero. You can change the page of current page or outside a page the size of new pages.  
10cm is about 283 points, unless you changed units ([DynaPDF.SetUserUnit](DynaPDFSetUserUnit.md)). Calculate with cm value divided by 2.54 cm/inch and multiplied with 72 points per inch.   
See also [DynaPDF.SetPageFormat](DynaPDFSetPageFormat.md) and [DynaPDF.SetPageHeight](DynaPDFSetPageHeight.md).   
  
Common paper formats and sizes in points:  
  
| Format | Size in units (Width x Height) |
|---|---|
| DIN A3 | 842.0 x 1191.0 |
| DIN A4 | 595.0 x 842.0 |
| DIN A5 | 419.0 x 595.0 |
| DIN B4 | 709.0 x 1001.0 |
| DIN B5 | 499.0 x 709.0 |
| DIN B6 | 354.0 x 499.0 |
| DIN C3 | 918.0 x 1298.0 |
| DIN C4 | 649.0 x 918.0 |
| DIN C5 | 459.0 x 649.0 |
| DIN C6 | 323.0 x 459.0 |
| DIN C65 | 323.0 x 649.0 |
| DIN DL | 312.0 x 624.0 |
| DIN E4 | 623.0 x 879.0 |
| DIN E5 | 439.0 x 624.0 |
| DIN E6 | 312.0 x 439.0 |
| DIN E65 | 312.0 x 624.0 |
| DIN M5 | 439.0 x 632.0 |
| DIN M65 | 317.0 x 632.0 |
| US Legal | 612.0 x 1008.0 |
| US Letter | 612.0 x 792.0 |

See also [SetPageWidth](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetPageWidth.shtml) function in DynaPDF manual.

### Examples

Sets page size:

 Set Variable \[$r ; Value:MBS ("DynaPDF.SetPageWidth"; $pdf ; 500)\]  
Set Variable \[$r ; Value:MBS ("[DynaPDF.SetPageHeight](DynaPDFSetPageHeight.md)"; $pdf ; 500)\]  
### See also

- [DynaPDF.GetLineWidth](DynaPDFGetLineWidth.md)
- [DynaPDF.GetPageField](DynaPDFGetPageField.md)
- [DynaPDF.GetPageMode](DynaPDFGetPageMode.md)
- [DynaPDF.GetPageWidth](DynaPDFGetPageWidth.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetLineWidth](DynaPDFSetLineWidth.md)
- [DynaPDF.SetPageBBox](DynaPDFSetPageBBox.md)
- [DynaPDF.SetPageFormat](DynaPDFSetPageFormat.md)
- [DynaPDF.SetPageHeight](DynaPDFSetPageHeight.md)
- [DynaPDF.SetUserUnit](DynaPDFSetUserUnit.md)

### Example Databases

- [DynaPDF/Book Creation](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Book%20Creation.shtml#3ScriptAnchor_)
- [DynaPDF/Convert to 2 Pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Convert%20to%202%20Pages.shtml#2ScriptAnchor_)
- [DynaPDF/Generate Previews](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Generate%20Previews.shtml#3ScriptAnchor_)
- [DynaPDF/Live Styled Text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Live%20Styled%20Text.shtml#3ScriptAnchor_)
- [DynaPDF/Merge PDFs](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Merge%20PDFs.shtml#11ScriptAnchor_)
- [DynaPDF/Picture to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Picture%20to%20PDF.shtml#3ScriptAnchor_)
- [DynaPDF/PSD Conversion](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/PSD%20Conversion.shtml#3ScriptAnchor_)
- [DynaPDF/Shrink PDF pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Shrink%20PDF%20pages.shtml#2ScriptAnchor_)
- [DynaPDF/WMF Conversion](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/WMF%20Conversion.shtml#3ScriptAnchor_)
- [OCR/OCR with DynaPDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/OCR/OCR%20with%20DynaPDF.shtml#1ScriptAnchor_)

### Blog Entries

- [Merge documents with DynaPDF](https://www.mbsplugins.de/archive/2023-07-06/Merge_documents_with_DynaPDF/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)
- [Create two page PDF document in FileMaker](https://www.mbsplugins.de/archive/2019-08-22/Create_two_page_PDF_document_i/monkeybreadsoftware_blog_filemaker)
- [Normalize PDF orientation with MBS Plugins and DynaPDF](https://www.mbsplugins.de/archive/2018-03-09/Normalize_PDF_orientation_with/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2022, Seite 34](https://filemaker-magazin.de/neuigkeit/4191-Appetithappen-FMM_202204)

This function checks for a license.

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

  
[DynaPDF.SetPageMode](DynaPDFSetPageMode.md) - [DynaPDF.SetPrintSettings](DynaPDFSetPrintSettings.md)

[HTML Version](DynaPDFSetPageWidth.shtml)