Class PDFTransformerConfig

java.lang.Object
org.apache.tika.fuzzing.pdf.PDFTransformerConfig

public class PDFTransformerConfig extends Object
  • Constructor Details

    • PDFTransformerConfig

      public PDFTransformerConfig()
  • Method Details

    • getRandomizeObjectNumbers

      public float getRandomizeObjectNumbers()
    • setRandomizeObjectNumbers

      public void setRandomizeObjectNumbers(float randomizeObjectNumbers)
      Parameters:
      randomizeObjectNumbers - probability that a given object number will be randomized. If < 0, this will be ignored.
    • getRandomizeRefNumbers

      public float getRandomizeRefNumbers()
    • setRandomizeRefNumbers

      public void setRandomizeRefNumbers(float randomizeRefNumbers)
      Parameters:
      randomizeRefNumbers - probability that a given reference number will be randomized. If < 0, this will be ignored.
    • getUnfilteredStreamTransformer

      public Transformer getUnfilteredStreamTransformer()
    • setUnfilteredStreamTransformer

      public void setUnfilteredStreamTransformer(Transformer transformer)
      This transformer is applied to the stream _before_ any filters are applied.
      Parameters:
      transformer -
    • getStreamTransformer

      public Transformer getStreamTransformer()
    • setStreamTransformer

      public void setStreamTransformer(Transformer transformer)
      This transformer is applied to the stream _after_ each filter has been applied.
      Parameters:
      transformer -
    • setMaxFilters

      public void setMaxFilters(int maxFilters)
      Parameters:
      maxFilters - maximum number of filters to apply
    • getAllowableFilters

      public Set<org.apache.pdfbox.cos.COSName> getAllowableFilters()
      Which filters are allowed
      Returns:
    • setAllowableFilters

      public void setAllowableFilters(Set<org.apache.pdfbox.cos.COSName> allowableFilters)
    • getFilters

      public List<org.apache.pdfbox.cos.COSName> getFilters(org.apache.pdfbox.cos.COSBase existingFilters)
      If maxFilters > 0, this will randomly select filters given the maxFilters and minFilters. If maxFilters < 0, this will return the existing filters.
      Parameters:
      existingFilters -
      Returns:
    • setMinFilters

      public void setMinFilters(int minFilters)
      Minimum number of filters to apply to streams.
      Parameters:
      minFilters -
    • getMaxFilteredStreamLength

      public long getMaxFilteredStreamLength()
    • setMaxFilteredStreamLength

      public void setMaxFilteredStreamLength(long maxFilteredStreamLength)
      Maximum filtered stream length. AsciiHex doubles the size of the stream with each encoding. This is used as a circuit breaker to stop adding filters if the stream goes above a given length.
      Parameters:
      maxFilteredStreamLength -