menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Enum PdfColorSpace - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    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.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved