Class PDFCProperty<T>

java.lang.Object
com.inet.pdfc.config.PDFCProperty<T>
Type Parameters:
T - the type of the property

public class PDFCProperty<T> extends Object
Enumeration of the various configuration properties which can be set for i-net PDFC.
See Also:
  • Field Details

    • CREATE_DIFFIMAGES

      @Deprecated public static final PDFCProperty<String> CREATE_DIFFIMAGES
      Specifies if a PNG image with the marked difference will be created. Such a image will be created for for each pair of pages if there are differences in elements, contained in these pages. The available values are: 'first' to paint only the original page, 'second' to paint only the new page and 'true' to paint both pages. Any other value will disable the difference images. The default value is: false.
    • CREATE_XORIMAGES

      @Deprecated public static final PDFCProperty<Boolean> CREATE_XORIMAGES
      Deprecated.
      As of i-net PDFC 5.0, see Settings.EXPORT.CREATE_XORIMAGES
      Creates an (negated) XOR image for any pair of pages with differences. The image will be stored as an PNG in the differences directory of the current comparison. If CREATE_DIFFIMAGES is enabled and set to 'true', the XOR image will be drawn onto the image created by CREATE_DIFFIMAGES between the two actual page images.
    • CREATE_ORIGIMAGES

      @Deprecated public static final PDFCProperty<Boolean> CREATE_ORIGIMAGES
      Deprecated.
      As of i-net PDFC 5.0, see Settings.EXPORT.CREATE_ORIGIMAGES
      Specifies if a PNG image with the original content will be created for each compared page. The default value is: false.
    • IMAGE_SCALE_FACTOR

      @Deprecated public static final PDFCProperty<Double> IMAGE_SCALE_FACTOR
      Deprecated.
      As of i-net PDFC 5.0, see Settings.IMAGE_SCALE_FACTOR
      Defines a scale factor for the generated images (original and difference images). The default is 1 which is no scaling.
    • LOG_LEVEL

      @Deprecated public static final PDFCProperty<String> LOG_LEVEL
      Deprecated.
      As of i-net PDFC 5.0, see PDFCCorePlugin.setLogLevel(com.inet.logging.LogLevel)
      Specifies the Logging Level. Available values: OFF, ERROR, WARN, INFO, ALL. OFF switches the output completely off. ERROR informs about the serious errors. WARN contains all the messages from ERROR-Level and furthermore, informs about the irregularities during the execution. INFO contains all the messages from WARN-Level and furthermore, describes settings and environment attributes. ALL is used to display the maximal information during the PDFC execution. The default value is: INFO.
    • LOG_FILE

      @Deprecated public static final PDFCProperty<String> LOG_FILE
      Deprecated.
      As of i-net PDFC 5.0, see PDFCCorePlugin.configureLogging(java.io.File)
      Specifies the file where logged information is to be stored.
      If a file is specified, the logging is written to the file, otherwise the logging is written to the console.
      Default is empty, logging to the console.
    • DOCUMENT_LANGUAGE

      public static final PDFCProperty<String> DOCUMENT_LANGUAGE
      Specifies the default language for the documents. If not set, the default locale of the machine will be used. This value will be used for text recognition. (For example to read incomplete fonts that have not unicode mapping)
    • MAX_ERRORS_PER_FILE

      @Deprecated public static final PDFCProperty<Integer> MAX_ERRORS_PER_FILE
      Deprecated.
      As of i-net PDFC 5.0, see Settings.MAX_ERRORS_PER_FILE
      Specifies the maximum number of errors that can occur before the comparison will be stopped for the current PDF file. The default value is: 100. [value: -1 for unlimited]
    • TOLERANCE_BOX_ROUND_EDGES

      public static final PDFCProperty<Double> TOLERANCE_BOX_ROUND_EDGES
      Specifies the maximum number of pixels (1 pixel is approximately 0.265mm) that a control point of a quadratic Bézier curve may differ in total before it is viewed as a difference. The default value is: 3.
    • TOLERANCE_IMAGE_DISTANCE

      public static final PDFCProperty<Double> TOLERANCE_IMAGE_DISTANCE
      Specifies the maximum number of pixels that the position of an image can differ before it is viewed as a difference. The default value is: 3.
    • TOLERANCE_IMAGE_PIXEL_VALUE

      public static final PDFCProperty<Double> TOLERANCE_IMAGE_PIXEL_VALUE
      Specifies the maximal allowed discrepancy of pixel values (Double) before it is viewed as a difference. The range of this property is [0,1]. The default value is: 0.05.
    • TOLERANCE_IMAGE_SIZE

      public static final PDFCProperty<Double> TOLERANCE_IMAGE_SIZE
      Specifies the maximum relative difference that the area spanned by an image may differ before it is viewed as a difference. The default value is: 0.1.
    • IMAGE_CHANGE_AREA

      public static final PDFCProperty<Boolean> IMAGE_CHANGE_AREA
      If the image compare block by block with better result. A disadvantages is , it need more performance.
    • IMAGE_META_COMPARISON

      public static final PDFCProperty<Boolean> IMAGE_META_COMPARISON
      True if should compare the image meta data, otherwise false. Image Meta Data are: Color Space DPI Image Format Has Alpha Channel/Alpha Mask
    • TOLERANCE_LINE_POSITION

      public static final PDFCProperty<Double> TOLERANCE_LINE_POSITION
      Specifies the maximum number of pixels that the position of a line or curves can differ per axis before it is viewed as a difference. The default value is: 3.
    • TOLERANCE_LINE_SIZE

      public static final PDFCProperty<Double> TOLERANCE_LINE_SIZE
      Specifies the maximum number of pixels that the length of a line can differ in total before it is viewed as a difference. The default value is: 2.
    • TOLERANCE_LINE_STYLE

      public static final PDFCProperty<Boolean> TOLERANCE_LINE_STYLE
      Specifies if a different line dash pattern, describing dashes and gaps used to stroke paths will be viewed as a difference. The default value is: false.
    • TOLERANCE_LINE_THICKNESS

      public static final PDFCProperty<Double> TOLERANCE_LINE_THICKNESS
      Specifies the maximum difference in stroke thickness of two lines or curves before it is viewed as a difference. The default value is: 1 pt (1 pt is approximately 0.353mm).
    • TOLERANCE_PAGE_LEFTCORNER

      public static final PDFCProperty<Double> TOLERANCE_PAGE_LEFTCORNER
      Specifies the maximum number of pixels that the left or top margin of a page can differ (is the upper left corner of all elements) before it is viewed as a difference. The default value is: 3.
    • TOLERANCE_PAGE_RATIO

      public static final PDFCProperty<Double> TOLERANCE_PAGE_RATIO
      Specifies the tolerance for the aspect ratio of the PDF page. The default value is: 0.01.
    • TOLERANCE_PAGE_SIZE

      public static final PDFCProperty<Double> TOLERANCE_PAGE_SIZE
      Specifies the maximum number of pixels that the width or height of a page can differ before it is viewed as a difference. The default value is: 2.
    • TOLERANCE_UNDERLINE_LENGTH

      public static final PDFCProperty<Double> TOLERANCE_UNDERLINE_LENGTH
      Specifies the maximum difference in percent, in which the length of underlines may differ before it is viewed as a difference. The default value is: 0.1.
    • TOLERANCE_TEXT_LOCATION

      public static final PDFCProperty<Double> TOLERANCE_TEXT_LOCATION
      Specifies the maximum allowed location jitter for matched text elements in pixels. Note, that the value is fractional just like the text coordinates in PDF documents. Any negative value will cause PDFC to ignore the text locations. Default is -1 which is disabled
      PLEASE NOTE: This property is meant to confirm identity, it may cause artifact in case of a modified text flow!
    • TOLERANCE_TEXT_SIZE

      public static final PDFCProperty<Double> TOLERANCE_TEXT_SIZE
      Defines the maximum relative font size difference for text. The default value is: 0.05 which is 5%
    • TOLERANCE_COLOR

      public static final PDFCProperty<Double> TOLERANCE_COLOR
      Defines the maximum color difference per RGB or HSB channel for all paints. The value is the absolute difference for HSB and absolute * 255 for RGB. The default value is: 0.01 which is 1%.
    • COMPARE_TEXT_STYLES

      public static final PDFCProperty<TextStyleType> COMPARE_TEXT_STYLES
      Specifies a comma-separated list of textstyles. TextStyleType modify the content of PDF files so that comparison of the files can ignore unwanted detail differences. Values should be the TextStyleType constants, comma-separated.
      See Also:
    • TEXT_ALIGN_RATIO

      public static final PDFCProperty<Double> TEXT_ALIGN_RATIO
      This value is the maximum allowed y-jitter for the text line identification. It's relative to the text height of the respective line. This value can be used to compensate rounding errors of different PDF generators
    • COMPARE_TEXT_CASE_SENSITIVE

      public static final PDFCProperty<Boolean> COMPARE_TEXT_CASE_SENSITIVE
      This switch toggles the case sensitivity of the text comparison. If set to 'false', all text elements will be compared as lower case. This cause the comparison to run slightly slower and take some more memory. The conversion to lower case will be performed using the default localization of the runtime.
      The default value is 'true'.
    • COMPARE_LINE_STYLES

      public static final PDFCProperty<Boolean> COMPARE_LINE_STYLES
      This is a parameter for any type of line/shape comparison - either paged or continuous. If set to 'true' the styles of all matched lines and shapes will be checked as well.
    • USE_PIXEL_MEDIUM_VALUE

      public static final PDFCProperty<Boolean> USE_PIXEL_MEDIUM_VALUE
      Specifies whether i-net PDFC should compare images using the average pixel values instead of single pixel values. The medium value is calculated as a mean value on 9 pixel around the given pixel. The default value is: true.
      See Also:
    • FIXED_HEADER_SIZE

      public static final PDFCProperty<Integer> FIXED_HEADER_SIZE
      Specify the property for header/footer filter
    • FILTERS

      public static final PDFCProperty<String> FILTERS
      Defines the filters to be used before the elements of the documents are passed to the comparer.
      Please not that filters are plugins. Each filter must be installed, activated in the configuration (server only) and listed in the FILTERS property to be enabled. Furthermore there could be additional properties to a filter. Please refer to the documentation of the filters for details.
      Migration note: As of version 4.0 this property replaces CONTINUOUS_FILTERS and MODULES
      Since:
      4.0
    • COMPARE_TYPES

      public static final PDFCProperty<CompareType> COMPARE_TYPES
      A comma separated list of CompareTypes to be included in the comparison
      Since:
      4.0
    • CONTINUOUS_DETECT_PAGES

      public static final PDFCProperty<Integer> CONTINUOUS_DETECT_PAGES
      Specifies whether the continuous compare can be splited instead of comparing all content at once.
      If set to a value greater zero, this specifies how many pages may be added or inserted before the comparison fails to match the content. The larger this value, the more precise the comparison will be. On the downside a large value will increase the memory consumption.
      If this value is set to zero, all content will be compared at one. This will give the optimum result on the cost of a maximum memory requirement.
    • CONTINUOUS_COMPARE

      public static final PDFCProperty<String> CONTINUOUS_COMPARE
      Enables / Disable continuous compare.
      A setting of CONTINUOUS will set the comparison to a mode which ignores the page gaps and compares all content one continuous stream. This mode ignores the absolute position of content element and takes only their relation to each other into account.
      A setting of STRICT will compare the documents page by page. This mode allows to check the exact absolute position of the content e.G. for print layouts. But: If there is any shift in the pages, this will cause all further content to be different.
      The default is: CONTINUOUS - Continuous mode
    • EXPORT_PDF_ALWAYS

      @Deprecated public static final PDFCProperty<Boolean> EXPORT_PDF_ALWAYS
      Deprecated.
      As of i-net PDFC 5.0, see Settings.EXPORT.ONLY_ON_DIFFERENCES
      Defines in which cases the PDF export should create an export file. This is only relevant in case the -p option is set when calling the i-net PDFC command line version.
      A setting of true will force the export to generate a PDF for any comparison.
      A setting of false will advise the export to only generate a PDF if any differences were found during a comparison.
      The default is false
    • COMPARE_ANNOTATIONS_DETAILED

      public static final PDFCProperty<Boolean> COMPARE_ANNOTATIONS_DETAILED
      Defines whether appearance differences in annotations will be separate and detailed differences or aggregated as number of differences only.
      Requires COMPARE_TYPE 'ANNOTATIONS' to have an effect
      A setting of true will create a separate difference for each single different element in each annotation.
      A setting of false will only count the appearance difference par annotation and show the number in a modification.
      s
      Since:
      21.10
    • FILTER_PATTERNS

      public static final PDFCProperty<String> FILTER_PATTERNS
      The CR-separated list of patterns for the RegExp Filter. Each line has the format:
      <filter pattern> | <'text' or 'regexp'> | <'active' or 'inactive'>
      The keywords text an regexp toggle between plain text and regular expression matching.
      The keywords active an inactive define whether a filter rule should be applied.
      If you want to match a multi-line string, please replace the expected line breaks by [[BR]], otherwise the filter will interpret the filter rule as several independent rules.
    • DIFF_MERGE_FACTOR

      public static final PDFCProperty<Integer> DIFF_MERGE_FACTOR
      Activates the merging of large differences with small matched areas. This helps to compensate scenarios where common words like 'and' and 'or' are matched in large area of added or deleted content.
      Use 0 or a negative value to deactivate the feature. NOTE: This factor is a trade-off and has to be well balanced if used. It will not cause false-negative (not hide differences) but may cause small false-positives (differences where the content is equal).
      The default is zero which deactivates the merge feature.
      Since:
      23.4
  • Constructor Details

    • PDFCProperty

      public PDFCProperty(String name, int defaultValue, int lowerBound, int upperBound)
      Creates a new integer PDFCProperty with the specified default value.
      Parameters:
      name - the property name.
      defaultValue - the default value for the property
      lowerBound - the lower bound for this int property
      upperBound - the upper bound for this int property
      Throws:
      IllegalStateException - if a property with that name was already defined
      Since:
      4.0
    • PDFCProperty

      public PDFCProperty(String name, double defaultValue, double lowerBound, double upperBound)
      Creates a new double PDFCProperty with the specified default value.
      Parameters:
      name - the property name.
      defaultValue - the default value for the property
      lowerBound - the lower bound for this lowerBound property
      upperBound - the upper bound for this upperBound property
      Throws:
      IllegalStateException - if a property with that name was already defined
      Since:
      4.0
    • PDFCProperty

      public PDFCProperty(String name, boolean defaultValue)
      Creates a new boolean PDFCProperty with the specified default value.
      Parameters:
      name - the property name.
      defaultValue - the default value for the property
      Throws:
      IllegalStateException - if a property with that name was already defined
      Since:
      4.0
    • PDFCProperty

      public PDFCProperty(String name, String defaultValue, String... validValues)
      Creates a new single-choice PDFCProperty with the specified default value and a set of valid values.
      Parameters:
      name - the property name.
      defaultValue - the default value for the property
      validValues - the valid values for this property
      Throws:
      IllegalStateException - if a property with that name was already defined
      Since:
      4.0
    • PDFCProperty

      public PDFCProperty(String name, String defaultValue, ValidValueProvider provider)
      Creates a new single-choice PDFCProperty with the specified default value and a set of valid values.
      Parameters:
      name - the property name.
      defaultValue - the default value for the property
      provider - the implementation that provides the valid values for this property along with the translations of these these values
      Throws:
      IllegalStateException - if a property with that name was already defined
      Since:
      5.0
    • PDFCProperty

      @SafeVarargs public PDFCProperty(String name, Class<T> validValues, D... defaultValue)
      Creates a new multi-choice PDFCProperty with the specified default value and a set of valid values.
      Type Parameters:
      D - the enum type
      Parameters:
      name - the property name.
      validValues - the enum which defines the valid values
      defaultValue - the default value for the property, this allows multiple selection by default
      Throws:
      IllegalStateException - if a property with that name was already defined
      Since:
      4.0
  • Method Details

    • name

      public String name()
      Get the name of the property
      Returns:
      the name
      Since:
      1.0
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • valueOf

      public static PDFCProperty<?> valueOf(String name)
      Get a PDFCProperty by name
      Parameters:
      name - the property name
      Returns:
      the property or null if there is no such property
      Since:
      1.0
    • values

      public static Collection<PDFCProperty<?>> values()
      Get all available values.
      Returns:
      the values
      Since:
      1.0
    • getDefaultValue

      public T getDefaultValue()
      Returns the default value of the property.
      Returns:
      the current default value.
      Since:
      1.0
    • isDeprecated

      public boolean isDeprecated()
      Returns whether this property is marked as deprecated.
      Returns:
      true if the key is no longer supported and should be removed or replaced, hence false
      Since:
      22.10
    • getType

      public Class<?> getType()
      Returns the type of the property value. Possible returns are:
      • Integer.class - for numeric values
      • Double.class - for fractional values
      • Boolean.class - for simple switches
      • String.class - for single choice values
      • Enum.class - for multi-choice values
      Returns:
      the type of this property
      Since:
      2.0
    • getLimits

      public com.inet.pdfc.util.Pair<Number> getLimits()
      Returns the lower and upper limit for numeric properties.
      Negative lower bounds are valid and in most cases interpreted as "inactive / automatic"
      Upper bounds with a value of Integer.MAX_VALUE or higher have to be interpreted as unlimited
      Returns:
      the lower and upper bound pair or null if the type is not numeric
      Since:
      2.0
    • getValidValues

      public Object[] getValidValues()
      Returns the available values in case of an String or Enum type.
      NOTE: In case of a String value, only a single choice of these values is allowed. If the type is Enum, it a multi-choice property. In that case, use toPropertyValue(Object[]) to simply get the property value from the users choice.
      Returns:
      the valid values if the type of this property is String or Enum, else null
      Since:
      2.0
    • getAvailableValues

      public List<ValidValueProvider.ValidValue> getAvailableValues()
      Returns the available values in case of an String or Enum type with an additional translation.
      NOTE: In case of a String value, only a single choice of these values is allowed. If the type is Enum, it a multi-choice property. In that case, use toPropertyValue(Object[]) to simply get the property value from the users choice.
      Returns:
      the valid values if the type of this property is String or Enum, else null
      Since:
      5.0
    • toPropertyValue

      public static String toPropertyValue(Object[] choice)
      Convenience function to get the property value for a multi-choice property.
      Parameters:
      choice - the users choice, may be empty or null as well
      Returns:
      the value to write to the properties
      Since:
      2.0
    • getSelectedValues

      public static Object[] getSelectedValues(IProfile config, PDFCProperty<?> property)
      Convenience function to get the selected enum values for an Enum type property
      Parameters:
      config - the config to get the current value from
      property - the property to get the value for
      Returns:
      the selected values or null if the property is not an Enum type.
      Since:
      2.0