Package org.apache.fop.pdf
Class PDFProfile
java.lang.Object
org.apache.fop.pdf.PDFProfile
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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
boolean
boolean
boolean
boolean
Returnsnull
if transparency is allowed, otherwise returns the profile that prevents it.boolean
void
setPDFAMode
(PDFAMode mode) Sets the PDF/A modevoid
setPDFUAMode
(PDFUAMode mode) void
setPDFVTMode
(PDFVTMode mode) Sets the PDF/X modevoid
setPDFXMode
(PDFXMode mode) Sets the PDF/X modetoString()
protected void
Validates if the requested profile combination is compatible.void
Checks if Actions are allowed.void
Checks if annotations are allowed.void
Checks if embedded files are allowed.void
Checks if encryption is allowed.void
Checks if the right PDF version is set.void
Checks if PostScript XObjects are allowed.void
Checks a few things required for tagged PDF.void
Checks if a title may be absent.void
verifyTransparencyAllowed
(String context) Checks if the use of transparency is allowed.
-
Field Details
-
pdfAMode
Indicates the PDF/A mode currently active. Defaults to "no restrictions", i.e. PDF/A not active. -
pdfUAMode
-
pdfXMode
Indicates the PDF/X mode currently active. Defaults to "no restrictions", i.e. PDF/X not active. -
pdfVTMode
-
-
Constructor Details
-
PDFProfile
Main constructor- Parameters:
doc
- the PDF document
-
-
Method Details
-
validateProfileCombination
protected void validateProfileCombination()Validates if the requested profile combination is compatible. -
getDocument
- Returns:
- the PDFDocument this profile is attached to
-
getPDFAMode
- Returns:
- the PDF/A mode
-
getPDFUAMode
-
isPDFAActive
public boolean isPDFAActive()- Returns:
- true if any PDF/A mode is active
-
setPDFAMode
Sets the PDF/A mode- Parameters:
mode
- the PDF/A mode
-
setPDFUAMode
-
getPDFXMode
- Returns:
- the PDF/X mode
-
getPDFVTMode
-
isPDFXActive
public boolean isPDFXActive()- Returns:
- true if any PDF/X mode is active
-
isPDFVTActive
public boolean isPDFVTActive() -
setPDFXMode
Sets the PDF/X mode- Parameters:
mode
- the PDF/X mode
-
setPDFVTMode
Sets the PDF/X mode- Parameters:
mode
- the PDF/X mode
-
toString
-
verifyEncryptionAllowed
public void verifyEncryptionAllowed()Checks if encryption is allowed. -
verifyPSXObjectsAllowed
public void verifyPSXObjectsAllowed()Checks if PostScript XObjects are allowed. -
verifyTransparencyAllowed
Checks if the use of transparency is allowed.- Parameters:
context
- Context information for the user to identify the problem spot
-
isTransparencyAllowed
Returnsnull
if transparency is allowed, otherwise returns the profile that prevents it.- Returns:
null
, or an object whosetoString
method returns the name of the profile that disallows transparency
-
verifyPDFVersion
public void verifyPDFVersion()Checks if the right PDF version is set. -
verifyTaggedPDF
public void verifyTaggedPDF()Checks a few things required for tagged PDF. -
isIDEntryRequired
public boolean isIDEntryRequired()- Returns:
- true if the ID entry must be present in the trailer.
-
isFontEmbeddingRequired
public boolean isFontEmbeddingRequired()- Returns:
- true if all fonts need to be embedded.
-
verifyTitleAbsent
public void verifyTitleAbsent()Checks if a title may be absent. -
isModDateRequired
public boolean isModDateRequired()- Returns:
- true if the ModDate Info entry must be present.
-
isTrappedEntryRequired
public boolean isTrappedEntryRequired()- Returns:
- true if the Trapped Info entry must be present.
-
isAnnotationAllowed
public boolean isAnnotationAllowed()- Returns:
- true if annotations are allowed
-
verifyAnnotAllowed
public void verifyAnnotAllowed()Checks if annotations are allowed. -
verifyActionAllowed
public void verifyActionAllowed()Checks if Actions are allowed. -
verifyEmbeddedFilesAllowed
public void verifyEmbeddedFilesAllowed()Checks if embedded files are allowed.
-