Package com.inet.pdfc.config
Class PDFCProperty<T>
java.lang.Object
com.inet.pdfc.config.PDFCProperty<T>
- Type Parameters:
T
- the type of the property
Enumeration of the various configuration properties which can be set for i-net PDFC.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final PDFCProperty<Boolean>
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.
sstatic final PDFCProperty<Boolean>
This is a parameter for any type of line/shape comparison - either paged or continuous.static final PDFCProperty<Boolean>
This switch toggles the case sensitivity of the text comparison.static final PDFCProperty<TextStyleType>
Specifies a comma-separated list of textstyles.static final PDFCProperty<CompareType>
A comma separated list ofCompareType
s to be included in the comparisonstatic final PDFCProperty<String>
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.static final PDFCProperty<Integer>
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.static final PDFCProperty<String>
Deprecated.static final PDFCProperty<Boolean>
Deprecated.As of i-net PDFC 5.0, seeSettings.EXPORT.CREATE_ORIGIMAGES
static final PDFCProperty<Boolean>
Deprecated.As of i-net PDFC 5.0, seeSettings.EXPORT.CREATE_XORIMAGES
static final PDFCProperty<Integer>
Activates the merging of large differences with small matched areas.static final PDFCProperty<String>
Specifies the default language for the documents.static final PDFCProperty<Boolean>
Deprecated.As of i-net PDFC 5.0, seeSettings.EXPORT.ONLY_ON_DIFFERENCES
static final PDFCProperty<String>
The CR-separated list of patterns for the RegExp Filter.static final PDFCProperty<String>
Defines the filters to be used before the elements of the documents are passed to the comparer.
Please not that filters are plugins.static final PDFCProperty<Integer>
Specify the property for header/footer filterstatic final PDFCProperty<Integer>
Specify the property for header/footer filterstatic final PDFCProperty<Boolean>
If the image compare block by block with better result.static final PDFCProperty<Boolean>
True if should compare the image meta data, otherwise false.static final PDFCProperty<Double>
Deprecated.As of i-net PDFC 5.0, seeSettings.IMAGE_SCALE_FACTOR
static final PDFCProperty<String>
Deprecated.As of i-net PDFC 5.0, seePDFCCorePlugin.configureLogging(java.io.File)
static final PDFCProperty<String>
Deprecated.As of i-net PDFC 5.0, seePDFCCorePlugin.setLogLevel(com.inet.logging.LogLevel)
static final PDFCProperty<Integer>
Deprecated.As of i-net PDFC 5.0, seeSettings.MAX_ERRORS_PER_FILE
static final PDFCProperty<Double>
This value is the maximum allowed y-jitter for the text line identification.static final PDFCProperty<Double>
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.static final PDFCProperty<Double>
Defines the maximum color difference per RGB or HSB channel for all paints.static final PDFCProperty<Double>
Specifies the maximum number of pixels that the position of an image can differ before it is viewed as a difference.static final PDFCProperty<Double>
Specifies the maximal allowed discrepancy of pixel values (Double) before it is viewed as a difference.static final PDFCProperty<Double>
Specifies the maximum relative difference that the area spanned by an image may differ before it is viewed as a difference.static final PDFCProperty<Double>
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.static final PDFCProperty<Double>
Specifies the maximum number of pixels that the length of a line can differ in total before it is viewed as a difference.static final PDFCProperty<Boolean>
Specifies if a different line dash pattern, describing dashes and gaps used to stroke paths will be viewed as a difference.static final PDFCProperty<Double>
Specifies the maximum difference in stroke thickness of two lines or curves before it is viewed as a difference.static final PDFCProperty<Double>
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.static final PDFCProperty<Double>
Specifies the tolerance for the aspect ratio of the PDF page.static final PDFCProperty<Double>
Specifies the maximum number of pixels that the width or height of a page can differ before it is viewed as a difference.static final PDFCProperty<Double>
Specifies the maximum allowed location jitter for matched text elements in pixels.static final PDFCProperty<Double>
Defines the maximum relative font size difference for text.static final PDFCProperty<Double>
Specifies the maximum difference in percent, in which the length of underlines may differ before it is viewed as a difference.static final PDFCProperty<Boolean>
Specifies whether i-net PDFC should compare images using the average pixel values instead of single pixel values. -
Constructor Summary
ConstructorDescriptionPDFCProperty
(String name, boolean defaultValue) Creates a new booleanPDFCProperty
with the specified default value.PDFCProperty
(String name, double defaultValue, double lowerBound, double upperBound) Creates a new doublePDFCProperty
with the specified default value.PDFCProperty
(String name, int defaultValue, int lowerBound, int upperBound) Creates a new integerPDFCProperty
with the specified default value.PDFCProperty
(String name, Class<T> validValues, D... defaultValue) Creates a new multi-choicePDFCProperty
with the specified default value and a set of valid values.PDFCProperty
(String name, String defaultValue, ValidValueProvider provider) Creates a new single-choicePDFCProperty
with the specified default value and a set of valid values.PDFCProperty
(String name, String defaultValue, String... validValues) Creates a new single-choicePDFCProperty
with the specified default value and a set of valid values. -
Method Summary
Modifier and TypeMethodDescriptionReturns the default value of the property.com.inet.pdfc.util.Pair<Number>
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 ofInteger.MAX_VALUE
or higher have to be interpreted as unlimitedstatic Object[]
getSelectedValues
(IProfile config, PDFCProperty<?> property) Convenience function to get the selected enum values for anEnum
type propertyClass<?>
getType()
Returns the type of the property value.Object[]
boolean
Returns whether this property is marked as deprecated.name()
Get the name of the propertystatic String
toPropertyValue
(Object[] choice) Convenience function to get the property value for a multi-choice property.toString()
static PDFCProperty<?>
Get a PDFCProperty by namestatic Collection<PDFCProperty<?>>
values()
Get all available values.
-
Field Details
-
CREATE_DIFFIMAGES
Deprecated.As of i-net PDFC 5.0, seeSettings.EXPORT.CREATE_DIFFIMAGES_FIRST
andSettings.EXPORT.CREATE_DIFFIMAGES_SECOND
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.As of i-net PDFC 5.0, seeSettings.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.As of i-net PDFC 5.0, seeSettings.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.As of i-net PDFC 5.0, seeSettings.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.As of i-net PDFC 5.0, seePDFCCorePlugin.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.As of i-net PDFC 5.0, seePDFCCorePlugin.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
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.As of i-net PDFC 5.0, seeSettings.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
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
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
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
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
If the image compare block by block with better result. A disadvantages is , it need more performance. -
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
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
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
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
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
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
Specifies the tolerance for the aspect ratio of the PDF page. The default value is: 0.01. -
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
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
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
Defines the maximum relative font size difference for text. The default value is: 0.05 which is 5% -
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
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 theTextStyleType
constants, comma-separated.- See Also:
-
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
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
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
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
Specify the property for header/footer filter -
FIXED_FOOTER_SIZE
Specify the property for header/footer filter -
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 theFILTERS
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
A comma separated list ofCompareType
s to be included in the comparison- Since:
- 4.0
-
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
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.As of i-net PDFC 5.0, seeSettings.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
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
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
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
Creates a new integerPDFCProperty
with the specified default value.- Parameters:
name
- the property name.defaultValue
- the default value for the propertylowerBound
- the lower bound for this int propertyupperBound
- the upper bound for this int property- Throws:
IllegalStateException
- if a property with that name was already defined- Since:
- 4.0
-
PDFCProperty
Creates a new doublePDFCProperty
with the specified default value.- Parameters:
name
- the property name.defaultValue
- the default value for the propertylowerBound
- the lower bound for this lowerBound propertyupperBound
- the upper bound for this upperBound property- Throws:
IllegalStateException
- if a property with that name was already defined- Since:
- 4.0
-
PDFCProperty
Creates a new booleanPDFCProperty
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
Creates a new single-choicePDFCProperty
with the specified default value and a set of valid values.- Parameters:
name
- the property name.defaultValue
- the default value for the propertyvalidValues
- the valid values for this property- Throws:
IllegalStateException
- if a property with that name was already defined- Since:
- 4.0
-
PDFCProperty
Creates a new single-choicePDFCProperty
with the specified default value and a set of valid values.- Parameters:
name
- the property name.defaultValue
- the default value for the propertyprovider
- 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
Creates a new multi-choicePDFCProperty
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 valuesdefaultValue
- 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
Get the name of the property- Returns:
- the name
- Since:
- 1.0
-
toString
-
valueOf
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
Get all available values.- Returns:
- the values
- Since:
- 1.0
-
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, hencefalse
- Since:
- 22.10
-
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
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 ofInteger.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
Returns the available values in case of anString
orEnum
type.
NOTE: In case of aString
value, only a single choice of these values is allowed. If the type isEnum
, it a multi-choice property. In that case, usetoPropertyValue(Object[])
to simply get the property value from the users choice. -
getAvailableValues
Returns the available values in case of anString
orEnum
type with an additional translation.
NOTE: In case of aString
value, only a single choice of these values is allowed. If the type isEnum
, it a multi-choice property. In that case, usetoPropertyValue(Object[])
to simply get the property value from the users choice. -
toPropertyValue
Convenience function to get the property value for a multi-choice property.- Parameters:
choice
- the users choice, may be empty ornull
as well- Returns:
- the value to write to the properties
- Since:
- 2.0
-
getSelectedValues
Convenience function to get the selected enum values for anEnum
type property- Parameters:
config
- the config to get the current value fromproperty
- the property to get the value for- Returns:
- the selected values or
null
if the property is not anEnum
type. - Since:
- 2.0
-
Settings.EXPORT.CREATE_DIFFIMAGES_FIRST
andSettings.EXPORT.CREATE_DIFFIMAGES_SECOND