Accusoft PDF Xpress Control v7.0
IsStrictlyDeviceGray Method
An integer value which represents a page number of the current document.
Description
Determines if the page strictly uses the color space DeviceGray for visible graphics.
Syntax
Visual Basic
Public Function IsStrictlyDeviceGray( _
   ByVal PageNumber As Long _
) As Boolean
Parameters
PageNumber
An integer value which represents a page number of the current document.
Remarks

Errors that could occur:

pdf.PdfError = 13691, pdf.PdfErrorMessage = The page is missing visible graphics; this happens when no visible graphic elements are found on the page, false is returned as there is no assurance that strictly DeviceGray is used on the page.

pdf.PdfError = 13658, pdf.PdfErrorMessage = Page number out of range; this happens if the input long pageNumber is invalid, i.e., -10.

err.Number vbObjectError = 13650, err.Description = This object is not associated with an instance of the PDFXpress control"; this happens if the PdfDocument IsStrictlyDeviceGray() is being called on does not first call SetParentControl().

Example

'This code snippet will demonstrate how to test if a specific page number of

'a document strictly uses the DeviceGray color space. If any other color space

'is used the result will be false. NOTE: this function doesn't examine color

'value, only the color space used

Private Sub IsDeviceGray()

On Error GoTo errorHandler

Dim pdf As New PdfXpress

pdf.Initialize()

 

Dim doc As New PdfDocument

doc.SetParentControl(pdf)

doc.OpenDocument("C:\\input.pdf", "password")

 

Dim isPage0StrictlyDeviceGray As Boolean

 

isPage0StrictlyDeviceGray = doc.IsStrictlyDeviceGray(0)

 

MsgBox("Does page 1 use strictly the DeviceGray color space? " _

& CStr(isPage0StrictlyDeviceGray))

 

pdf = Nothing

Exit Sub

errorHandler:

  MsgBox(Err.Description)

End Sub

See Also

PdfDocument Object  | PdfDocument Members

 

 


©2017. Accusoft Corporation. All Rights Reserved.

Send Feedback