PDFKit.SetPDFPageDisplayAnnotation
----------------------------------

Sets whether annotations are drawn.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PDFKit](component_PDFKit.md) | [6.0](newinversion60.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "PDFKit.SetPDFPageDisplayAnnotation"; PDF; Index; Value ) 

**MBS**( **"PDFKit.SetPDFPageDisplayAnnotation";** /\* Sets whether annotations are drawn. \*/  
**$PDF**; /\* The PDF reference number. \*/   
**$Index**; /\* The index of the page. From zero to [PDFKit.GetPDFPageCount](PDFKitGetPDFPageCount.md)-1.e.g. 1 \*/   
**$Value**) /\* The new value for whether to display annotations. Can be 0 or 1.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference number. | $pdf |
| Index | The index of the page. From zero to [PDFKit.GetPDFPageCount](PDFKitGetPDFPageCount.md)-1. | 1 |
| Value | The new value for whether to display annotations. Can be 0 or 1. | 1 |

### Result

Returns OK or error.

### Description

Sets whether annotations are drawn.  
Function to turn on or off the display of annotations when the page is drawn.  
  
Your changes are only done in memory, so please remember to write modified pdf back to disk, e.g. by using [PDFKit.WriteToPath](PDFKitWriteToPath.md). Or use [PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md) to get a PDF for storing in a container.  
### Examples

Render with or without image:

 Set Variable \[$pdf ; Value:MBS ( "[PDFKit.OpenContainer](PDFKitOpenContainer.md)"; PDFKit Rendering::PDF )\]  
Set Variable \[$r ; Value:MBS ( "PDFKit.SetPDFPageDisplayAnnotation"; $pdf ; 0; 0 )\]  
Set Field \[PDFKit Rendering::Image1 ; MBS ( "[PDFKit.GetPDFPageImage](PDFKitGetPDFPageImage.md)"; $pdf ; 0)\]  
Set Variable \[$r ; Value:MBS ( "PDFKit.SetPDFPageDisplayAnnotation"; $pdf ; 0; 1 )\]  
Set Field \[PDFKit Rendering::Image2 ; MBS ( "[PDFKit.GetPDFPageImage](PDFKitGetPDFPageImage.md)"; $pdf ; 0)\]  
Set Variable \[$r ; Value:MBS ("[PDFKit.Release](PDFKitRelease.md)"; $pdf )\]  
### See also

- [PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md)
- [PDFKit.GetPDFPageCount](PDFKitGetPDFPageCount.md)
- [PDFKit.GetPDFPageDisplayAnnotation](PDFKitGetPDFPageDisplayAnnotation.md)
- [PDFKit.GetPDFPageImage](PDFKitGetPDFPageImage.md)
- [PDFKit.Open](PDFKitOpen.md)
- [PDFKit.OpenContainer](PDFKitOpenContainer.md)
- [PDFKit.Release](PDFKitRelease.md)
- [PDFKit.WriteToPath](PDFKitWriteToPath.md)

This function checks for a license.

Created 30th November 2015 , last changed 25th April 2016

  
[PDFKit.SetPDFAttribute](PDFKitSetPDFAttribute.md) - [PDFKit.SetPDFPageRotation](PDFKitSetPDFPageRotation.md)

[HTML Version](PDFKitSetPDFPageDisplayAnnotation.shtml)