DynaPDF.IsColorPage
-------------------

Checks whether a page is a color page or if all graphic elements of the page use black &amp; white only.

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

MBS( "DynaPDF.IsColorPage"; PDF { ; GrayIsColor } ) 

**MBS**( **"DynaPDF.IsColorPage";** /\* Checks whether a page is a color page or if all graphic elements of the page use black &amp; white only. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$GrayIsColor**) /\* Optional; Boolean whether gray should count as color.  
Default is 0.  
Pass 1 to count gray as color.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |  |
| GrayIsColor | Boolean whether gray should count as color.   Default is 0.   Pass 1 to count gray as color. | 0 | Optional |

### Result

Returns 1, 0 or error.

### Description

Checks whether a page is a color page or if all graphic elements of the page use black &amp; white only.   
If the parameter GrayIsColor is true, gray shades are treated as color. The page which should be checked must be opened with the function [DynaPDF.EditPage](DynaPDFEditPage.md) beforehand.   
Complex color spaces such as Lab, Separation, DeviceN, Colored Tiling Patterns, and Shadings are always treated as color. The function does not return when a color is set, the color must be used by an object.   
If an object of the page uses a color, the return value is 1. If no object uses a color the return value is 0.   
  
See also [DynaPDF.IsEmptyPage](DynaPDFIsEmptyPage.md).  
See also [IsColorPage](https://www.monkeybreadsoftware.com/DynaPDF-Manual/IsColorPage.shtml) function in DynaPDF manual.

### Examples

Check if first page has color:

 Set Variable \[ $pdf ; Value: MBS ("[DynaPDF.New](DynaPDFNew.md)") \]   
\# Load PDF from container   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)"; $pdf ; Start::SourcePDF ) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)"; $pdf ) \]   
\# Query image list   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.EditPage](DynaPDFEditPage.md)"; $pdf ; 1) \]   
Show Custom Dialog \[ MBS ( "DynaPDF.IsColorPage"; $PDF ) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.EndPage](DynaPDFEndPage.md)"; $pdf ) \]   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.Release](DynaPDFRelease.md)"; $pdf ) \]  
### See also

- [DynaPDF.ConvertColors](DynaPDFConvertColors.md)
- [DynaPDF.EditPage](DynaPDFEditPage.md)
- [DynaPDF.EndPage](DynaPDFEndPage.md)
- [DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)
- [DynaPDF.IsEmptyPage](DynaPDFIsEmptyPage.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)
- [DynaPDF.Release](DynaPDFRelease.md)

### Release notes

- **Version 9.2**
    - Fixed [DynaPDF.IsColorPage](http://www.mbsplugins.eu/DynaPDFIsColorPage.shtml) function result.

### Blog Entries

- [Was gibt es neues bei MBS Version 9.2](https://www.mbsplugins.de/archive/2019-07-16/Was_gibt_es_neues_bei_MBS_Vers/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.2pr4](https://www.mbsplugins.de/archive/2019-04-25/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 6th February 2015 , last changed 9th November 2021

  
[DynaPDF.InsertMetafileEx](DynaPDFInsertMetafileEx.md) - [DynaPDF.IsEmptyPage](DynaPDFIsEmptyPage.md)

[HTML Version](DynaPDFIsColorPage.shtml)