Class PdfColorSpace
Defines set of color spaces.
Inheritance
System.Object
PdfColorSpace
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public sealed class PdfColorSpace : Enum
Examples
// Create a PDF Document.
PdfDocument doc = new PdfDocument();
//Add pages to the document
PdfPage page = doc.Pages.Add();
//Create PDF graphics for the page
PdfGraphics graphics = page.Graphics;
//Create PDF font.
PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular);
//Set the color space.
graphics.ColorSpace = PdfColorSpace.GrayScale;
//Get the graphics client size.
SizeF clientSize = graphics.ClientSize;
//Draw rectangle to PDF graphics.
graphics.DrawRectangle(PdfBrushes.Red, new RectangleF(PointF.Empty, clientSize));
//Save the document
doc.Save("Output.pdf");
//Close the document
doc.Close(true);
' Create a PDF Document.
Dim doc As New PdfDocument()
'Add pages to the document
Dim page As PdfPage = doc.Pages.Add()
'Create PDF graphics for the page
Dim graphics As PdfGraphics = page.Graphics
'Create PDF font.
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Helvetica, 12, PdfFontStyle.Regular)
'Set the color space.
graphics.ColorSpace = PdfColorSpace.GrayScale
'Get the graphics client size.
Dim clientSize As SizeF = graphics.ClientSize
'Draw rectangle to PDF graphics.
graphics.DrawRectangle(PdfBrushes.Red, New RectangleF(PointF.Empty, clientSize))
'Save the document
doc.Save("Output.pdf")
'Close the document
doc.Close(True)
Fields
CMYK
CMYK color space.
Declaration
public const PdfColorSpace CMYK
Field Value
Type |
---|
PdfColorSpace |
GrayScale
GrayScale color space.
Declaration
public const PdfColorSpace GrayScale
Field Value
Type |
---|
PdfColorSpace |
Indexed
Indexed color space used internally.
Declaration
public const PdfColorSpace Indexed
Field Value
Type |
---|
PdfColorSpace |
RGB
RGB color space.
Declaration
public const PdfColorSpace RGB
Field Value
Type |
---|
PdfColorSpace |