org.apache.fop.pdf

Class PDFProfile


public class PDFProfile
extends java.lang.Object

This class allows tracks the enabled PDF profiles (PDF/A and PDF/X) and provides methods to the libarary and its users to enable the generation of PDFs conforming to the enabled PDF profiles.

Some profile from PDF/X and PDF/A can be active simultaneously (example: PDF/A-1 and PDF/X-3:2003).

Field Summary

protected PDFAMode
pdfAMode
Indicates the PDF/A mode currently active.
protected PDFXMode
pdfXMode
Indicates the PDF/X mode currently active.

Constructor Summary

PDFProfile(PDFDocument doc)
Main constructor

Method Summary

PDFDocument
getDocument()
PDFAMode
getPDFAMode()
PDFXMode
getPDFXMode()
boolean
isAnnotationAllowed()
boolean
isFontEmbeddingRequired()
boolean
isIDEntryRequired()
boolean
isModDateRequired()
boolean
isPDFAActive()
boolean
isPDFXActive()
boolean
isTrappedEntryRequired()
void
setPDFAMode(PDFAMode mode)
Sets the PDF/A mode
void
setPDFXMode(PDFXMode mode)
Sets the PDF/X mode
String
toString()
protected void
validateProfileCombination()
Validates if the requested profile combination is compatible.
void
verifyActionAllowed()
Checks if Actions are allowed.
void
verifyAnnotAllowed()
Checks if annotations are allowed.
void
verifyEncryptionAllowed()
Checks if encryption is allowed.
void
verifyPDFVersion()
Checks if the right PDF version is set.
void
verifyPSXObjectsAllowed()
Checks if PostScript XObjects are allowed.
void
verifyTitleAbsent()
Checks if a title may be absent.
void
verifyTransparencyAllowed(String context)
Checks if the use of transparency is allowed.

Field Details

pdfAMode

protected PDFAMode pdfAMode
Indicates the PDF/A mode currently active. Defaults to "no restrictions", i.e. PDF/A not active.

pdfXMode

protected PDFXMode pdfXMode
Indicates the PDF/X mode currently active. Defaults to "no restrictions", i.e. PDF/X not active.

Constructor Details

PDFProfile

public PDFProfile(PDFDocument doc)
Main constructor
Parameters:
doc - the PDF document

Method Details

getDocument

public PDFDocument getDocument()
Returns:
the PDFDocument this profile is attached to

getPDFAMode

public PDFAMode getPDFAMode()
Returns:
the PDF/A mode

getPDFXMode

public PDFXMode getPDFXMode()
Returns:
the PDF/X mode

isAnnotationAllowed

public boolean isAnnotationAllowed()
Returns:
true if annotations are allowed

isFontEmbeddingRequired

public boolean isFontEmbeddingRequired()
Returns:
true if all fonts need to be embedded.

isIDEntryRequired

public boolean isIDEntryRequired()
Returns:
true if the ID entry must be present in the trailer.

isModDateRequired

public boolean isModDateRequired()
Returns:
true if the ModDate Info entry must be present.

isPDFAActive

public boolean isPDFAActive()
Returns:
true if any PDF/A mode is active

isPDFXActive

public boolean isPDFXActive()
Returns:
true if any PDF/X mode is active

isTrappedEntryRequired

public boolean isTrappedEntryRequired()
Returns:
true if the Trapped Info entry must be present.

setPDFAMode

public void setPDFAMode(PDFAMode mode)
Sets the PDF/A mode
Parameters:
mode - the PDF/A mode

setPDFXMode

public void setPDFXMode(PDFXMode mode)
Sets the PDF/X mode
Parameters:
mode - the PDF/X mode

toString

public String toString()
See Also:
java.lang.Object.toString()

validateProfileCombination

protected void validateProfileCombination()
Validates if the requested profile combination is compatible.

verifyActionAllowed

public void verifyActionAllowed()
Checks if Actions are allowed.

verifyAnnotAllowed

public void verifyAnnotAllowed()
Checks if annotations are allowed.

verifyEncryptionAllowed

public void verifyEncryptionAllowed()
Checks if encryption is allowed.

verifyPDFVersion

public void verifyPDFVersion()
Checks if the right PDF version is set.

verifyPSXObjectsAllowed

public void verifyPSXObjectsAllowed()
Checks if PostScript XObjects are allowed.

verifyTitleAbsent

public void verifyTitleAbsent()
Checks if a title may be absent.

verifyTransparencyAllowed

public void verifyTransparencyAllowed(String context)
Checks if the use of transparency is allowed.
Parameters:
context - Context information for the user to identify the problem spot

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.