Class PdfTrapNetworkAnnotation


public class PdfTrapNetworkAnnotation extends PdfAnnotation
A PdfTrapNetworkAnnotation may 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.

  • Constructor Details

    • PdfTrapNetworkAnnotation

      public PdfTrapNetworkAnnotation (Rectangle rect, PdfFormXObject appearanceStream)
      Creates a PdfTrapNetworkAnnotation instance. 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. See PdfAnnotation.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 (see PdfFormXObject.setProcessColorModel(PdfName). See also ISO-320001 Table 367 "Additional entries specific to a trap network appearance stream".
    • PdfTrapNetworkAnnotation

      protected PdfTrapNetworkAnnotation (PdfDictionary pdfObject)
      Creates a PdfLineAnnotation instance from the given PdfDictionary that 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 - the PdfDictionary representing annotation object
      See Also:
  • Method Details

    • getSubtype

      public PdfName getSubtype()
      Gets a PdfName which value is a subtype of this annotation. See ISO-320001 12.5.6, "Annotation Types" for the reference to the possible types.
      Specified by:
      getSubtype in class PdfAnnotation
      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 - a PdfDate wrapper with the specified date.
      Returns:
      this PdfTrapNetworkAnnotation instance.
    • getLastModified

      public PdfString getLastModified()
      The date and time when the trap network was most recently modified.
      Returns:
      a PdfString with date. The format should be a date string as described in ISO-320001 7.9.4, "Dates". See also PdfDate.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 unordered PdfArray of 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 PdfTrapNetworkAnnotation instance.
    • 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 PdfArray of 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 entry PdfAnnotation.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 be PdfNull. No appearance state shall be included for the trap network annotation itself.

      Required if /Version (getVersion()) is present; shall be absent if /LastModified getLastModified() is present.
      Parameters:
      annotStates - a PdfArray of name objects representing the appearance states for annotations associated with the page.
      Returns:
      this PdfTrapNetworkAnnotation instance.
    • getAnnotStates

      public PdfArray getAnnotStates()
      An array of name objects representing the appearance states for annotations associated with the page. See also setAnnotStates(PdfArray).
      Returns:
      a PdfArray of 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 - a PdfArray of PdfDictionary each of which represent font in the document.
      Returns:
      this PdfTrapNetworkAnnotation instance.
    • setFauxedFonts

      public PdfTrapNetworkAnnotation setFauxedFonts (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 - a List of PdfFont objects.
      Returns:
      this PdfTrapNetworkAnnotation instance.
    • 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 PdfArray of PdfDictionary each of which represent font in the document.