IccProfile
Represents an ICC profile resource.
public class IccProfile : Resource
Public Class IccProfile
Inherits Resource
Inheritance: ObjectResourceIccProfile
Licensing Info
This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
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. |
IccProfile(Stream) | Initializes a new instance of the IccProfile class. |
IccProfile(String) | Initializes a new instance of the IccProfile class. |
Properties
RequiredPdfObjects | Gets the number of PDF objects required by the resource. (Inherited from Resource) |
ResourceType | Gets the type of resource. (Inherited from Resource) |
Uid | Gets the unique ID of the resource. (Inherited from Resource) |
Methods
Draw(DocumentWriter) | Draws the ICC profile data to the given DocumentWriter object. |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |