Package com.itextpdf.kernel.pdf.annot
Class PdfTrapNetworkAnnotation
- java.lang.Object
-
- com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
-
- com.itextpdf.kernel.pdf.annot.PdfAnnotation
-
- com.itextpdf.kernel.pdf.annot.PdfTrapNetworkAnnotation
-
public class PdfTrapNetworkAnnotation extends PdfAnnotation
APdfTrapNetworkAnnotationmay be used to define the trapping characteristics for a page of a PDF document. Trapping is the process of adding marks to a page along colour boundaries to avoid unwanted visual artifacts resulting from misregistration of colorants when the page is printed. TrapNet annotations are deprecated in PDF 2.0.See ISO-320001 14.11.6 "Trapping Support" and 14.11.6.2 "Trap Network Annotations" in particular.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.itextpdf.kernel.pdf.annot.PdfAnnotation
PdfAnnotation.PdfUnknownAnnotation
-
-
Field Summary
-
Fields inherited from class com.itextpdf.kernel.pdf.annot.PdfAnnotation
Accepted, Canceled, Completed, HIDDEN, HIGHLIGHT_INVERT, HIGHLIGHT_NONE, HIGHLIGHT_OUTLINE, HIGHLIGHT_PUSH, HIGHLIGHT_TOGGLE, INVISIBLE, LOCKED, LOCKED_CONTENTS, Marked, MarkedModel, NO_ROTATE, NO_VIEW, NO_ZOOM, None, page, PRINT, READ_ONLY, Rejected, ReviewModel, STYLE_BEVELED, STYLE_DASHED, STYLE_INSET, STYLE_SOLID, STYLE_UNDERLINE, TOGGLE_NO_VIEW, Unmarked
-
-
Constructor Summary
Constructors Modifier Constructor Description PdfTrapNetworkAnnotation(Rectangle rect, PdfFormXObject appearanceStream)Creates aPdfTrapNetworkAnnotationinstance.protectedPdfTrapNetworkAnnotation(PdfDictionary pdfObject)Creates aPdfLineAnnotationinstance from the givenPdfDictionarythat represents existing annotation object in the document.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PdfArraygetAnnotStates()An array of name objects representing the appearance states for annotations associated with the page.PdfArraygetFauxedFonts()An array of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the generation of trap networks for the page.PdfStringgetLastModified()The date and time when the trap network was most recently modified.PdfNamegetSubtype()Gets aPdfNamewhich value is a subtype of this annotation.PdfArraygetVersion()An unordered array of all objects present in the page description at the time the trap networks were generated and that, if changed, could affect the appearance of the page.PdfTrapNetworkAnnotationsetAnnotStates(PdfArray annotStates)An array of name objects representing the appearance states (value of the /AS entryPdfAnnotation.getAppearanceState()) for annotations associated with the page.PdfTrapNetworkAnnotationsetFauxedFonts(PdfArray fauxedFonts)An array of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the generation of trap networks for the page.PdfTrapNetworkAnnotationsetFauxedFonts(java.util.List<PdfFont> fauxedFonts)A list of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the generation of trap networks for the page.PdfTrapNetworkAnnotationsetLastModified(PdfDate lastModified)The date and time when the trap network was most recently modified.PdfTrapNetworkAnnotationsetVersion(PdfArray version)An unordered array of all objects present in the page description at the time the trap networks were generated and that, if changed, could affect the appearance of the page.-
Methods inherited from class com.itextpdf.kernel.pdf.annot.PdfAnnotation
addAssociatedFile, flush, getAppearanceDictionary, getAppearanceObject, getAppearanceState, getAssociatedFiles, getBlendMode, getBorder, getColorObject, getContents, getDate, getDownAppearanceObject, getFlags, getLang, getName, getNonStrokingOpacity, getNormalAppearanceObject, getPage, getPageObject, getRectangle, getRolloverAppearanceObject, getStrokingOpacity, getStructParentIndex, getTitle, hasFlag, isWrappedObjectMustBeIndirect, makeAnnotation, put, remove, resetFlag, setAppearance, setAppearance, setAppearanceState, setBlendMode, setBorder, setBorder, setColor, setColor, setColor, setContents, setContents, setDate, setDownAppearance, setDownAppearance, setFlag, setFlags, setLang, setLayer, setName, setNonStrokingOpacity, setNormalAppearance, setNormalAppearance, setPage, setRectangle, setRolloverAppearance, setRolloverAppearance, setStrokingOpacity, setStructParentIndex, setTitle
-
Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
-
-
-
Constructor Detail
-
PdfTrapNetworkAnnotation
public PdfTrapNetworkAnnotation(Rectangle rect, PdfFormXObject appearanceStream)
Creates aPdfTrapNetworkAnnotationinstance. Note that there shall be at most one trap network annotation per page, which shall be the last element in the page’s Annots array. TrapNet annotations are deprecated in PDF 2.0.- Parameters:
rect- the annotation rectangle, defining the location of the annotation on the page in default user space units. SeePdfAnnotation.setRectangle(PdfArray).appearanceStream- the form XObject defining a trap network which body contains the graphics objects needed to paint the traps making up the trap network. Process colour model shall be defined for the appearance stream (seePdfFormXObject.setProcessColorModel(PdfName). See also ISO-320001 Table 367 "Additional entries specific to a trap network appearance stream".
-
PdfTrapNetworkAnnotation
protected PdfTrapNetworkAnnotation(PdfDictionary pdfObject)
Creates aPdfLineAnnotationinstance from the givenPdfDictionarythat represents existing annotation object in the document. This method is useful for property reading in reading mode or modifying in stamping mode. TrapNet annotations are deprecated in PDF 2.0.- Parameters:
pdfObject- thePdfDictionaryrepresenting annotation object- See Also:
PdfAnnotation.makeAnnotation(PdfObject)
-
-
Method Detail
-
getSubtype
public PdfName getSubtype()
Gets aPdfNamewhich value is a subtype of this annotation. See ISO-320001 12.5.6, "Annotation Types" for the reference to the possible types.- Specified by:
getSubtypein classPdfAnnotation- Returns:
- subtype of this annotation.
-
setLastModified
public PdfTrapNetworkAnnotation setLastModified(PdfDate lastModified)
The date and time when the trap network was most recently modified.This entry is required if /Version (
getVersion()) and /AnnotStates (getAnnotStates()) entries are absent; shall be absent if /Version and /AnnotStates entries are present.- Parameters:
lastModified- aPdfDatewrapper with the specified date.- Returns:
- this
PdfTrapNetworkAnnotationinstance.
-
getLastModified
public PdfString getLastModified()
The date and time when the trap network was most recently modified.- Returns:
- a
PdfStringwith date. The format should be a date string as described in ISO-320001 7.9.4, "Dates". See alsoPdfDate.decode(String).
-
setVersion
public PdfTrapNetworkAnnotation setVersion(PdfArray version)
An unordered array of all objects present in the page description at the time the trap networks were generated and that, if changed, could affect the appearance of the page.
This entry is required if /AnnotStates (getAnnotStates()) is present; shall be absent if /LastModified (getLastModified()) is present.- Parameters:
version- an unorderedPdfArrayof all objects present in the page description at the time the trap networks were generated. If present, the array shall include the following objects:- all page content streams;
- all page resource objects (other than procedure sets);
- all resource objects (other than procedure sets) of any form XObjects on the page;
- all OPI dictionaries associated with XObjects on the page (see ISO-320001 14.11.7, "Open Prepress Interface (OPI)")
- Returns:
- this
PdfTrapNetworkAnnotationinstance.
-
getVersion
public PdfArray getVersion()
An unordered array of all objects present in the page description at the time the trap networks were generated and that, if changed, could affect the appearance of the page.- Returns:
- an unordered
PdfArrayof all objects present in the page description at the time the trap networks were generated.
-
setAnnotStates
public PdfTrapNetworkAnnotation setAnnotStates(PdfArray annotStates)
An array of name objects representing the appearance states (value of the /AS entryPdfAnnotation.getAppearanceState()) for annotations associated with the page. The appearance states shall be listed in the same order as the annotations in the page’s /Annots array. For an annotation with no /AS entry, the corresponding array element should bePdfNull. No appearance state shall be included for the trap network annotation itself.
Required if /Version (getVersion()) is present; shall be absent if /LastModifiedgetLastModified()is present.- Parameters:
annotStates- aPdfArrayof name objects representing the appearance states for annotations associated with the page.- Returns:
- this
PdfTrapNetworkAnnotationinstance.
-
getAnnotStates
public PdfArray getAnnotStates()
An array of name objects representing the appearance states for annotations associated with the page. See alsosetAnnotStates(PdfArray).- Returns:
- a
PdfArrayof name objects representing the appearance states for annotations associated with the page,
-
setFauxedFonts
public PdfTrapNetworkAnnotation setFauxedFonts(PdfArray fauxedFonts)
An array of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the generation of trap networks for the page.- Parameters:
fauxedFonts- aPdfArrayofPdfDictionaryeach of which represent font in the document.- Returns:
- this
PdfTrapNetworkAnnotationinstance.
-
setFauxedFonts
public PdfTrapNetworkAnnotation setFauxedFonts(java.util.List<PdfFont> fauxedFonts)
A list of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the generation of trap networks for the page.- Parameters:
fauxedFonts- aListofPdfFontobjects.- Returns:
- this
PdfTrapNetworkAnnotationinstance.
-
getFauxedFonts
public PdfArray getFauxedFonts()
An array of font dictionaries representing fonts that were fauxed (replaced by substitute fonts) during the generation of trap networks for the page.- Returns:
- a
PdfArrayofPdfDictionaryeach of which represent font in the document.
-
-