Skip to main content

IccProfile

Version: 11.0

cete.dynamicpdf.iccprofile

IccProfile​

Represents an ICC profile resource.

public class IccProfile : Resource
Public Class IccProfile
Inherits Resource

Inheritance: Object → Resource → IccProfile

Examples​

Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.Text

Module MyModule

Sub Main()
' Create a document and set it's properties
Dim MyDocument As ceTe.DynamicPDF.Document = New ceTe.DynamicPDF.Document
MyDocument.Title = "PDF/X-1a Document"
MyDocument.PdfVersion = PdfVersion.v1_4

' Create a page to add to the document
Dim MyPage As ceTe.DynamicPDF.Page = New ceTe.DynamicPDF.Page(PageSize.Letter, PageOrientation.Portrait, 54.0F)

MyDocument.PdfXVersion = PdfXVersion.PDF_X_1a_2003
Dim MyIccProfile As IccProfile = New IccProfile("C:\ICC Profiles\USWebCoatedSWOP.icc")
Dim MyOutputIntent As OutputIntent = New OutputIntent("CGATS TR 001-1995 (SWOP)", "CGATS TR 001", "http://www.color.org", "U.S. Web Coated (SWOP) v2", MyIccProfile)
MyDocument.OutputIntents.Add(MyOutputIntent)
MyDocument.Trapped = Trapped.False

' Create a Label using a OpenType font and CMYK color
Dim Text As String = "PDF/X 1-a Document"
Dim MyOpenTypeFont As OpenTypeFont = New OpenTypeFont("verdana.otf")
Dim MyLabel As Label = New Label(Text, 0, 0, 504, 100, MyOpenTypeFont, 18, TextAlign.Center, CmykColor.BlueViolet)

' Add label to page
MyPage.Elements.Add(MyLabel)

' Add page to document
MyDocument.Pages.Add(MyPage)

' Save the PDF Document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Text;

public class Example
{
public static void CreatePDF(string inputIccProfilePath, string inputFontPath, string outputPath)
{
// Create a document and set it's properties
ceTe.DynamicPDF.Document document = new ceTe.DynamicPDF.Document();
document.Title = "PDF/X-1a Document";
document.PdfVersion = PdfVersion.v1_4;
// Create a page to add to the document
ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page( PageSize.Letter, PageOrientation.Portrait, 54.0f );
document.PdfXVersion = PdfXVersion.PDF_X_1a_2003;
IccProfile iccProfile = new IccProfile( inputIccProfilePath );
OutputIntent outputIntent = new OutputIntent( "CGATS TR 001-1995 (SWOP)", "CGATS TR 001", "http://www.color.org", "U.S. Web Coated (SWOP) v2", iccProfile );
document.OutputIntents.Add( outputIntent );
document.Trapped = Trapped.False;
// Create a Label using a OpenType font and CMYK color
string text = "PDF/X 1-a Document";
OpenTypeFont openTypeFont = new OpenTypeFont( inputFontPath );
Label label = new Label( text, 0, 0, 504, 100, openTypeFont, 18, TextAlign.Center, CmykColor.BlueViolet );
// Add label to page
page.Elements.Add( label );
// Add page to document
document.Pages.Add( page );
// Save the PDF document
document.Draw( outputPath );
}
}

Remarks​

For more details on creating PDF/X documents take a look at the PDF/X topic.

Constructors​

IccProfile(Byte[])​

Initializes a new instance of the IccProfile class.

public IccProfile(Byte[] iccProfile)
Public Sub New (iccProfile As Byte())

Parameters​

A byte array containing the ICC profile data.

IccProfile(Stream)​

Initializes a new instance of the IccProfile class.

public IccProfile(Stream iccProfile)
Public Sub New (iccProfile As Stream)

Parameters​

Stream object containing the ICC profile data.

IccProfile(String)​

Initializes a new instance of the IccProfile class.

public IccProfile(string filePath)
Public Sub New (filePath As String)

Parameters​

A Physical path to the file containing the ICC profile data.

Properties​

RequiredPdfObjects​

Gets the number of PDF objects required by the resource. (Inherited from Resource)

public int RequiredPdfObjects { get; }
Public Property RequiredPdfObjects As Int32

Property Value​

Int32

ResourceType​

Gets the type of resource. (Inherited from Resource)

public ResourceType ResourceType { get; }
Public Property ResourceType As ResourceType

Property Value​

ResourceType

Uid​

Gets the unique ID of the resource. (Inherited from Resource)

public long Uid { get; }
Public Property Uid As Int64

Property Value​

Int64

Methods​

Draw(DocumentWriter)​

Draws the ICC profile data to the given DocumentWriter object.

public void Draw(DocumentWriter writer)
Sub Draw(writer As DocumentWriter)

Parameters​

DocumentWriter object to receive the ICC profile's output.

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF