Enum PdfColorSpace
Defines set of color spaces.
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public enum PdfColorSpace
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
Name | Description |
---|---|
CMYK | CMYK color space. |
GrayScale | GrayScale color space. |
Indexed | Indexed color space used internally. |
RGB | RGB color space. |