Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfColorSpace

    Show / Hide Table of Contents

    Class PdfColorSpace

    Defines set of color spaces.

    Inheritance
    System.Object
    PdfColorSpace
    Namespace: Syncfusion.Pdf.Graphics
    Assembly: Syncfusion.Pdf.Portable.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 Description
    PdfColorSpace

    GrayScale

    GrayScale color space.

    Declaration
    public const PdfColorSpace GrayScale
    Field Value
    Type Description
    PdfColorSpace

    Indexed

    Indexed color space used internally.

    Declaration
    public const PdfColorSpace Indexed
    Field Value
    Type Description
    PdfColorSpace

    RGB

    RGB color space.

    Declaration
    public const PdfColorSpace RGB
    Field Value
    Type Description
    PdfColorSpace

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved