Enum OutputProfiler.Strategy

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AdjustXMPNamespaces
      Strategy that will adjust any namespaces in the XMP so they meet the rules required by XMP.
      AutoConformance
      Where a PDF cannot meet a particular level of conformance, such as PDF/A-1a or PDF/A-2a, give the OutputProfiler to downgrade the level of conformance to PDF/A-1b, PDF/A-2b etc.
      ConvertAttachments
      PDF/A-2 and later permit attachments but only if the attachments are themselves valid PDF/A-2 documents.
      Default
      The default strategy will not delete any content to make the OutputProfile match
      FlattenDisallowedAnnotations
      If disallowed annotation types are found, flatten them onto the page rather than removing them.
      JustFixIt
      Strategy that will do whatever it takes to make the PDF match the target OutputProfile, removing whatever it takes to get there.
      Rebuild
      Where a PDF cannot be repaired, this option will copy the content to a new PDF, reset the current PDF and move the content back.
      RecolorAnnotations
      Strategy that will convert CMYK to RGB (or vice versa) in annotations if that's what's required to match the target OutputProfile.
      RemoveColorProfile
      Strategy that will remove ICC Profiles if that's what's required to match the target OutputProfile.
      RemoveEmbeddedFiles
      Strategy that will remove any Embedded Files that cannot be made compliant.
      RemoveForm
      Strategy that will remove any form content that cannot be made to match the target OutputProfile, including the XFA form, signed signatures that are invalid for any reason
      RemoveHiddenAnnotations
      If hidden annotations are not allowed in the target OutputProfile, by default they will be made visible.
      RemoveInvalidXMPFields
      Strategy that will remove invalid or undefined fields from the XMP
      RemoveInvalidXMPProperties
      Strategy that will remove invalid or undefined properties from the XMP
      RemoveRelaxNGSchema
      Strategy that will remove the RelaxNG schema from the XMP if required to meet the target OutputProfile.
      RemoveSignatures
      Strategy that will remove signed signatures by flattening them onto the page, if that's what's required to match the target OutputProfile.
      RepairToUnicodeCodeLength
      The ToUnicode map, used to give meaning to glyphs in the PDF, is sometimes created in a particular way (with two-byte codes where single-bye are requried) that means it must be ignored by Acrobat.
      SeparationMergeAcrobat
      PDF/A-2 and later require that the same color definition is used for each Separation plate in the PDF.
      SeparationMergeRename
      PDF/A-2 and later require that the same color definition is used for each Separation plate in the PDF.
    • Enum Constant Detail

      • Default

        public static final OutputProfiler.Strategy Default
        The default strategy will not delete any content to make the OutputProfile match
      • RemoveInvalidXMPProperties

        public static final OutputProfiler.Strategy RemoveInvalidXMPProperties
        Strategy that will remove invalid or undefined properties from the XMP
      • RemoveInvalidXMPFields

        public static final OutputProfiler.Strategy RemoveInvalidXMPFields
        Strategy that will remove invalid or undefined fields from the XMP
      • AdjustXMPNamespaces

        public static final OutputProfiler.Strategy AdjustXMPNamespaces
        Strategy that will adjust any namespaces in the XMP so they meet the rules required by XMP. In practice, this means that any namespace UR that does not end in a "#" or "/" will have a "#" appended to it.
      • RemoveRelaxNGSchema

        public static final OutputProfiler.Strategy RemoveRelaxNGSchema
        Strategy that will remove the RelaxNG schema from the XMP if required to meet the target OutputProfile.
      • RemoveForm

        public static final OutputProfiler.Strategy RemoveForm
        Strategy that will remove any form content that cannot be made to match the target OutputProfile, including the XFA form, signed signatures that are invalid for any reason
      • RemoveSignatures

        public static final OutputProfiler.Strategy RemoveSignatures
        Strategy that will remove signed signatures by flattening them onto the page, if that's what's required to match the target OutputProfile.
      • RemoveColorProfile

        public static final OutputProfiler.Strategy RemoveColorProfile
        Strategy that will remove ICC Profiles if that's what's required to match the target OutputProfile.
      • RecolorAnnotations

        public static final OutputProfiler.Strategy RecolorAnnotations
        Strategy that will convert CMYK to RGB (or vice versa) in annotations if that's what's required to match the target OutputProfile. Setting this strategy will set an appropriate ColorAction on the OutputProfiler if none exists.
      • Rebuild

        public static final OutputProfiler.Strategy Rebuild
        Where a PDF cannot be repaired, this option will copy the content to a new PDF, reset the current PDF and move the content back. It's guaranteed to result in a valid file
      • AutoConformance

        public static final OutputProfiler.Strategy AutoConformance
        Where a PDF cannot meet a particular level of conformance, such as PDF/A-1a or PDF/A-2a, give the OutputProfiler to downgrade the level of conformance to PDF/A-1b, PDF/A-2b etc. This is very useful if the "Rebuild" option is set - if the supplied PDF is PDF/A-1a but the damage to the PDF is such that the StructureTree has to be removed, downgrading to PDF/A-1b is an alternative to failing. Even if the PDF is not being rebuilt, if it's found that a PDF cannot meet PDF/A-2u but can met PDF/A-2b, it will be applied
      • RemoveEmbeddedFiles

        public static final OutputProfiler.Strategy RemoveEmbeddedFiles
        Strategy that will remove any Embedded Files that cannot be made compliant.
      • RemoveHiddenAnnotations

        public static final OutputProfiler.Strategy RemoveHiddenAnnotations
        If hidden annotations are not allowed in the target OutputProfile, by default they will be made visible. This will often alter the appearance of the PDF, so an alternative if this Strategy is set is to remove them.
      • FlattenDisallowedAnnotations

        public static final OutputProfiler.Strategy FlattenDisallowedAnnotations
        If disallowed annotation types are found, flatten them onto the page rather than removing them.
      • SeparationMergeAcrobat

        public static final OutputProfiler.Strategy SeparationMergeAcrobat
        PDF/A-2 and later require that the same color definition is used for each Separation plate in the PDF. This leads to problems when one color is defined twice using two wildly different colors, which happens more than you'd think. Acrobat has an ad-hoc process for choosing which one to use, which we believe we've largely derived, and this algorithm will attempt to replicate as closely as possible. Where it's unable to, the page will be rasterized. This is the default stratagy used by JustFixIt.
      • SeparationMergeRename

        public static final OutputProfiler.Strategy SeparationMergeRename
        PDF/A-2 and later require that the same color definition is used for each Separation plate in the PDF. This leads to problems when one color is defined twice using two different colors. This strategy will simply rename different one of the separations. As Acrobat has its own resolution approach, this will lead to different results if the PDF is relying on Acrobat's resolution being applied. But the results will, at least, be predictable across all PDF viewers, and different separations will not result in rasterization. This strategy will be ignored if SeparationMergeAcrobat is set.
      • ConvertAttachments

        public static final OutputProfiler.Strategy ConvertAttachments
        PDF/A-2 and later permit attachments but only if the attachments are themselves valid PDF/A-2 documents. This strategy will attempt to convert the attachment to PDF/A-2.
      • RepairToUnicodeCodeLength

        public static final OutputProfiler.Strategy RepairToUnicodeCodeLength
        The ToUnicode map, used to give meaning to glyphs in the PDF, is sometimes created in a particular way (with two-byte codes where single-bye are requried) that means it must be ignored by Acrobat. It's relatively easy to repair this, and usually it's the right thing to do. Occasionally the ToUnicode map is completely incorrect and repairing it means the text no long extracts correctly. There's no way to know this, and it depends on the document. On average, with relatively modern documents, we find that repairing it is more likely to help than to break things, so this is on by default.
        Since:
        2.26.1
      • JustFixIt

        public static final OutputProfiler.Strategy JustFixIt
        Strategy that will do whatever it takes to make the PDF match the target OutputProfile, removing whatever it takes to get there.
    • Method Detail

      • values

        public static OutputProfiler.Strategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (OutputProfiler.Strategy c : OutputProfiler.Strategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OutputProfiler.Strategy valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null