Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


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

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 5.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.IsColorPage"; PDF { ; GrayIsColor } )   More


Parameter Description Example Flags
PDF The PDF reference returned from DynaPDF.New. $pdf
GrayIsColor Boolean whether gray should count as color.
Default is 0.
Pass 1 to count gray as color.
0 Optional


Returns 1, 0 or error.


Checks whether a page is a color page or if all graphic elements of the page use black & 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 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.

See also IsColorPage function in DynaPDF manual.


Check if first page has color:

Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
# Load PDF from container
Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Start::SourcePDF) ]
Set Variable [ $r ; Value: MBS("DynaPDF.ImportPDFFile"; $pdf) ]
# Query image list
Set Variable [ $r ; Value: MBS("DynaPDF.EditPage"; $pdf; 1) ]
Show Custom Dialog [ MBS( "DynaPDF.IsColorPage"; $PDF ) ]
Set Variable [ $r ; Value: MBS("DynaPDF.EndPage"; $pdf) ]
Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]

See also

Release notes

Blog Entries

This function checks for a license.

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

DynaPDF.InsertMetafileEx - DynaPDF.IsEmptyPage

💬 Ask a question or report a problem