cete.dynamicpdf.iccprofile
IccProfile
- Namespace: ceTe.DynamicPDF
- Assemblies: ceTe.DynamicPDF.40.dll
Represents an ICC profile resource.
public class IccProfile : Resource
Public Class IccProfile
Inherits Resource
Inheritance: Object → Resource → IccProfile
Licensing
This class is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
Examples
Imports System
Imports ceTe.DynamicPDF
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.Prepress.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 TrueType 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.Text;
class MyClass
{static void Main(){ // 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.Prepress.PdfXVersion = PdfXVersion.PDF_X_1a_2003; IccProfile iccProfile = new IccProfile( @"C:\ICC Profiles\USWebCoatedSWOP.icc" ); 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 TrueType font and CMYK color string text = "PDF/X 1-a Document"; OpenTypeFont openTypeFont = new OpenTypeFont( "verdana.otf" ); 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( @"C:\MyDocument.pdf" );}
}
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
- iccProfile: Byte[]
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
- iccProfile: Stream
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
- filePath: String
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
ResourceType
Gets the type of resource. (Inherited from Resource)
public ResourceType ResourceType { get; }
Public Property ResourceType As ResourceType
Property Value
Uid
Gets the unique ID of the resource. (Inherited from Resource)
public long Uid { get; }
Public Property Uid As Int64
Property Value
Methods
Draw(DocumentWriter)
Draws the ICC profile data to the given DocumentWriter object.
public void Draw(DocumentWriter writer)
Sub Draw(writer As DocumentWriter)
Parameters
- writer: DocumentWriter
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
- obj: Object
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 .