OutputIntent Class
An output intent that specifies the color characteristics of the intended output device.
Declaration
public class OutputIntent extends JavaObject
Remarks
An output intent contains an ICC profile (a destination output profile) for an output device or production condition. PDF/A requires an output intent if the document uses device-dependent colors (DeviceRGB, DeviceCMYK, or DeviceGray).
Call the PdfDocument.getOutputIntents() method to access output intents of a document.
Refer to the following help topic for additional information: Convert and Validate PDF/A and PDF/UA Documents — PDF Document API for Java.
Example
Get Output Intents of a PDF/A Document
The following code snippet converts a document to PDF/A-2b and prints the output intents of the converted document:
import java.io.*;
import java.nio.file.*;
import com.devexpress.docs.pdf.*;
public class Main {
public static void main(String[] args) throws Exception {
try (InputStream inputStream = Files.newInputStream(Path.of("Document.pdf"));
PdfDocument pdfDocument = new PdfDocument(inputStream)) {
pdfDocument.convertToPdfA(PdfACompatibility.PDF_A2B);
for (OutputIntent intent : pdfDocument.getOutputIntents()) {
System.out.println("Subtype: " + intent.getSubtype());
System.out.println("Output condition: " + intent.getOutputConditionIdentifier());
System.out.println("Color components: " + intent.getComponentsCount());
}
}
}
}
Inherited Members
Inheritance
Constructors
OutputIntent(String outputConditionIdentifier, byte[] iccProfile, int componentsCount) Constructor
Initializes a new instance of the OutputIntent class with the specified output condition identifier and ICC profile.
Declaration
public OutputIntent(String outputConditionIdentifier, byte[] iccProfile, int componentsCount)
Parameters
| Name | Type | Description |
|---|---|---|
| outputConditionIdentifier | String | The output condition identifier (for example, |
| iccProfile | byte[] | The ICC profile data, or |
| componentsCount | int | The number of color components in the ICC profile ( |
Exceptions
| Type | Description |
|---|---|
| ArgumentOutOfRangeException | Thrown if the |
Remarks
The OutputIntent(outputConditionIdentifier, iccProfile, componentsCount) constructor creates a PDF/A output intent (the PDF_A_SUBTYPE subtype).
OutputIntent(String subtype, String outputConditionIdentifier, String outputCondition, String registryName, String info, byte[] iccProfile, int componentsCount) Constructor
Initializes a new instance of the OutputIntent class with the specified subtype, output condition, and ICC profile.
Declaration
public OutputIntent(String subtype, String outputConditionIdentifier, String outputCondition, String registryName, String info, byte[] iccProfile, int componentsCount)
Parameters
| Name | Type | Description |
|---|---|---|
| subtype | String | The output intent subtype (for example, |
| outputConditionIdentifier | String | The output condition identifier (for example, |
| outputCondition | String | A human-readable description of the output condition. |
| registryName | String | The name of the registry that defines the output condition. |
| info | String | Additional information about the output condition. |
| iccProfile | byte[] | The ICC profile data, or |
| componentsCount | int | The number of color components in the ICC profile ( |
Exceptions
| Type | Description |
|---|---|
| ArgumentException | Thrown if the |
| ArgumentOutOfRangeException | Thrown if the |
Fields
PDF_A_SUBTYPE Field
The output intent subtype for PDF/A documents.
Declaration
public static final String PDF_A_SUBTYPE
Field Value
| Type | Description |
|---|---|
| String | The output intent subtype for PDF/A documents, |
Methods
getComponentsCount() Method
Returns the number of color components in the ICC profile.
Declaration
public int getComponentsCount()
Returns
| Type | Description |
|---|---|
| int | The number of color components ( |
getIccProfile() Method
Returns the ICC profile of the output intent.
Declaration
public byte[] getIccProfile()
Returns
| Type | Description |
|---|---|
| byte[] | The ICC profile data, or |
getInfo() Method
Returns additional information about the output condition.
Declaration
public String getInfo()
Returns
| Type | Description |
|---|---|
| String | Additional information about the output condition. |
getOutputCondition() Method
Returns a human-readable description of the output condition.
Declaration
public String getOutputCondition()
Returns
| Type | Description |
|---|---|
| String | The output condition description. |
getOutputConditionIdentifier() Method
Returns the output condition identifier.
Declaration
public String getOutputConditionIdentifier()
Returns
| Type | Description |
|---|---|
| String | The output condition identifier (for example, |
getRegistryName() Method
Returns the name of the registry that defines the output condition.
Declaration
public String getRegistryName()
Returns
| Type | Description |
|---|---|
| String | The registry name. |
getSubtype() Method
Returns the output intent subtype.
Declaration
public String getSubtype()
Returns
| Type | Description |
|---|---|
| String | The output intent subtype (for example, |