DynaPDF.SetContent
------------------

Replaces the content stream of the currently open page or template with a new one.

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

MBS( "DynaPDF.SetContent"; PDF; Content ) 

**MBS**( **"DynaPDF.SetContent";** /\* Replaces the content stream of the currently open page or template with a new one. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Content**) /\* The new content data. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Content | The new content data. |  |

### Result

Returns OK or error.

### Description

Replaces the content stream of the currently open page or template with a new one.   
If the parameter Buffer is empty the content stream of the page or template will be deleted. In the latter case page resources such as fonts, images and so on will be deleted from the page object too.   
Use this function in combination with [DynaPDF.GetContent](DynaPDFGetContent.md) if you need to change a content stream in a manner that DynaPDF does not supports. Do never change a content stream when you don't know exactly what you are doing.   
See also [SetContent](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetContent.shtml) function in DynaPDF manual.

### See also

- [DynaPDF.GetAscent](DynaPDFGetAscent.md)
- [DynaPDF.GetContent](DynaPDFGetContent.md)
- [DynaPDF.GetDescent](DynaPDFGetDescent.md)
- [DynaPDF.GetFontCount](DynaPDFGetFontCount.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.SetFont](DynaPDFSetFont.md)
- [DynaPDF.SetFontEx](DynaPDFSetFontEx.md)
- [DynaPDF.SetFontWeight](DynaPDFSetFontWeight.md)
- [DynaPDF.SetTabLen](DynaPDFSetTabLen.md)
- [DynaPDF.SetTextRect](DynaPDFSetTextRect.md)

### Release notes

- **Version 7.0**
    - Added [DynaPDF.GetContent](http://www.mbsplugins.eu/DynaPDFGetContent.shtml) and [DynaPDF.SetContent](http://www.mbsplugins.eu/DynaPDFSetContent.shtml).

### Blog Entries

- [MBS FileMaker Plugin, version 7.0pr1](https://www.mbsplugins.de/archive/2017-01-02/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 13th December 2016 , last changed 13th December 2016

  
[DynaPDF.SetCompressionLevel](DynaPDFSetCompressionLevel.md) - [DynaPDF.SetDateTimeFormat](DynaPDFSetDateTimeFormat.md)

[HTML Version](DynaPDFSetContent.shtml)