ConvertToGrayscale(Boolean,Boolean,Boolean,Boolean,Boolean) Method
Converts specified content of currently selected page of the loaded PDF document to grayscale.
public GdPictureStatus ConvertToGrayscale(
bool ,
bool ,
bool ,
bool ,
bool
)
public function ConvertToGrayscale(
: Boolean;
: Boolean;
: Boolean;
: Boolean;
: Boolean
): GdPictureStatus;
public function ConvertToGrayscale(
: boolean,
: boolean,
: boolean,
: boolean,
: boolean
) : GdPictureStatus;
public: GdPictureStatus ConvertToGrayscale(
bool ,
bool ,
bool ,
bool ,
bool
)
public:
GdPictureStatus ConvertToGrayscale(
bool ,
bool ,
bool ,
bool ,
bool
)
'Declaration
Public Overloads Function ConvertToGrayscale( _
ByVal As Boolean, _
ByVal As Boolean, _
ByVal As Boolean, _
ByVal As Boolean, _
ByVal As Boolean _
) As GdPictureStatus
Parameters
- Text
- Set this parameter to true if you want to convert all text on page to grayscale, otherwise set it to false.
- Graphics
- Set this parameter to true if you want to convert all path - based graphic objects on page to grayscale, otherwise set it to false.
- Images
- Set this parameter to true if you want to convert all images on page to grayscale, otherwise set it to false.
- Annotations
- Set this parameter to true if you want to convert all annotations on page to grayscale, otherwise set it to false.
- FormFields
- Set this parameter to true if you want to convert all form fields on page to grayscale, otherwise set it to false.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
How to convert images on the selected page to grayscale.
Using gdpicturePDF As New GdPicturePDF
gdpicturePDF.LoadFromFile("input.pdf")
gdpicturePDF.SelectPage(2)
gdpicturePDF.ConvertToGrayscale(False, False, True, False, False)
gdpicturePDF.SaveToFile("output.pdf")
End Using
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
gdpicturePDF.LoadFromFile("input.pdf");
gdpicturePDF.SelectPage(2);
gdpicturePDF.ConvertToGrayscale(false, false, true, false, false);
gdpicturePDF.SaveToFile("output.pdf");
}