Class PdfDeviceColorSpace
Represents a device colorspace.
Inherited Members
Namespace: Syncfusion.Pdf.ColorSpace
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public class PdfDeviceColorSpace : PdfColorSpaces, IPdfWrapper, IPdfCache
Examples
// Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document.
PdfPage page = doc.Pages.Add();
RectangleF rect = new RectangleF(20, 70, 200, 100);
PdfExponentialInterpolationFunction function = new PdfExponentialInterpolationFunction(true);
float[] numArray = new float[3];
numArray[0] = 0.38f;
numArray[1] = 0.88f;
function.C1 = numArray;
PdfSeparationColorSpace colorspace = new PdfSeparationColorSpace();
colorspace.AlternateColorSpaces = new PdfDeviceColorSpace(PdfColorSpace.RGB);
colorspace.TintTransform = function;
colorspace.Colorant = "PANTONE Orange 021 C";
PdfSeparationColor color = new PdfSeparationColor(colorspace);
color.Tint = 0.7;
PdfBrush brush = new PdfSolidBrush(color);
page.Graphics.DrawRectangle(brush, rect);
doc.Save("DeviceColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page.
Dim page As PdfPage = doc.Pages.Add()
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
Dim [function] As PdfExponentialInterpolationFunction = New PdfExponentialInterpolationFunction(True)
Dim numArray() As Single = New Single(2){}
numArray(0) = 0.38f
numArray(1) = 0.88f
[function].C1 = numArray
Dim colorspace As PdfSeparationColorSpace = New PdfSeparationColorSpace()
colorspace.AlternateColorSpaces = New PdfDeviceColorSpace(PdfColorSpace.RGB)
colorspace.TintTransform = [function]
colorspace.Colorant = "PANTONE Orange 021 C"
Dim color As PdfSeparationColor = New PdfSeparationColor(colorspace)
color.Tint = 0.7
Dim brush As PdfBrush = New PdfSolidBrush(color)
page.Graphics.DrawRectangle(brush, rect)
doc.Save("DeviceColorSpace.pdf")
Constructors
PdfDeviceColorSpace(PdfColorSpace)
Initializes a new instance of the PdfDeviceColorSpace class.
Declaration
public PdfDeviceColorSpace(PdfColorSpace colorspace)
Parameters
Type | Name | Description |
---|---|---|
PdfColorSpace | colorspace | The colorspace. |
Examples
// Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document.
PdfPage page = doc.Pages.Add();
RectangleF rect = new RectangleF(20, 70, 200, 100);
PdfExponentialInterpolationFunction function = new PdfExponentialInterpolationFunction(true);
float[] numArray = new float[3];
numArray[0] = 0.38f;
numArray[1] = 0.88f;
function.C1 = numArray;
PdfSeparationColorSpace colorspace = new PdfSeparationColorSpace();
colorspace.AlternateColorSpaces = new PdfDeviceColorSpace(PdfColorSpace.RGB);
colorspace.TintTransform = function;
colorspace.Colorant = "PANTONE Orange 021 C";
PdfSeparationColor color = new PdfSeparationColor(colorspace);
color.Tint = 0.7;
PdfBrush brush = new PdfSolidBrush(color);
page.Graphics.DrawRectangle(brush, rect);
doc.Save("DeviceColorSpace.pdf");
' Create a new PDF document.
Dim doc As PdfDocument = New PdfDocument()
' Create a page.
Dim page As PdfPage = doc.Pages.Add()
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
Dim [function] As PdfExponentialInterpolationFunction = New PdfExponentialInterpolationFunction(True)
Dim numArray() As Single = New Single(2){}
numArray(0) = 0.38f
numArray(1) = 0.88f
[function].C1 = numArray
Dim colorspace As PdfSeparationColorSpace = New PdfSeparationColorSpace()
colorspace.AlternateColorSpaces = New PdfDeviceColorSpace(PdfColorSpace.RGB)
colorspace.TintTransform = [function]
colorspace.Colorant = "PANTONE Orange 021 C"
Dim color As PdfSeparationColor = New PdfSeparationColor(colorspace)
color.Tint = 0.7
Dim brush As PdfBrush = New PdfSolidBrush(color)
page.Graphics.DrawRectangle(brush, rect)
doc.Save("DeviceColorSpace.pdf")
See Also
Properties
DeviceColorSpaceType
Gets or sets the DeviceColorSpaceType
Declaration
public PdfColorSpace DeviceColorSpaceType { get; set; }
Property Value
Type |
---|
PdfColorSpace |
Examples
// Creates a new document
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
PdfExponentialInterpolationFunction function = new PdfExponentialInterpolationFunction(true);
float[] numArray = new float[1];
numArray[0] = 0.38f;
function.C1 = numArray;
PdfSeparationColorSpace colorspace = new PdfSeparationColorSpace();
// Creates device color space
PdfDeviceColorSpace deviceColorspace1 = new PdfDeviceColorSpace(PdfColorSpace.CMYK);
deviceColorspace1.DeviceColorSpaceType = PdfColorSpace.GrayScale;
// Set the device color space
colorspace.AlternateColorSpaces = deviceColorspace1;
colorspace.TintTransform = function;
colorspace.Colorant = "PANTONE Orange 021 C";
PdfSeparationColor color = new PdfSeparationColor(colorspace);
color.Tint = 0.7;
PdfBrush brush = new PdfSolidBrush(color);
RectangleF rect = new RectangleF(20, 70, 200, 100);
page.Graphics.DrawRectangle(brush, rect);
doc.Save("DeviceColorSpace.pdf");
' Creates a new document
Dim doc As PdfDocument = New PdfDocument()
' Create a page
Dim page As PdfPage = doc.Pages.Add()
Dim [function] As PdfExponentialInterpolationFunction = New PdfExponentialInterpolationFunction(True)
Dim numArray() As Single = New Single(0){}
numArray(0) = 0.38f
[function].C1 = numArray
Dim colorspace As PdfSeparationColorSpace = New PdfSeparationColorSpace()
' Creates device color space
Dim deviceColorspace1 As PdfDeviceColorSpace = New PdfDeviceColorSpace(PdfColorSpace.CMYK)
deviceColorspace1.DeviceColorSpaceType = PdfColorSpace.GrayScale
' Set the device color space
colorspace.AlternateColorSpaces = deviceColorspace1
colorspace.TintTransform = [function]
colorspace.Colorant = "PANTONE Orange 021 C"
Dim color As PdfSeparationColor = New PdfSeparationColor(colorspace)
color.Tint = 0.7
Dim brush As PdfBrush = New PdfSolidBrush(color)
Dim rect As RectangleF = New RectangleF(20, 70, 200, 100)
page.Graphics.DrawRectangle(brush, rect)
doc.Save("DeviceColorSpace.pdf")