Generated by
JDiff

com.itextpdf.kernel.utils Documentation Differences

This file contains all the changes in documentation in the package com.itextpdf.kernel.utils as colored differences. Deletions are shown like this , and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a tag will cause all subsequent paragraphs to be displayed differently.

Class CompareTool.CompareResult, constructor CompareTool.CompareResult(int)

Creates new empty instance of CompareResult with given limit of difference messages. @param messageLimit maximum number of difference messages handled by this CompareResult.
Class CompareTool.CompareResult, Map getDifferences()

Returns map with ObjectPath as keys and difference descriptions as values. @return differences map which could be used to find in the document objects that are different.
Class CompareTool.CompareResult, int getErrorCount()

Returns number of differences between two documents met during comparison. @return number of differences.
Class CompareTool.CompareResult, String getReport()

Converts this CompareResult into text form. @return text report of the differences between two documents.
Class CompareTool.CompareResult, boolean isOk()

Is used to define if documents are considered equal after comparison. @return true if documents are equal, false otherwise.
Class CompareTool.CompareResult, void writeReportToXml(OutputStream)

Converts this CompareResult into xml form. @param stream output stream to which xml report will be written. @throws ParserConfigurationException @throws TransformerException

Class CompareTool.ObjectPath

Class that helps to find two corresponding objects in the comparing documents and also keeps track of the already met in comparing process parent indirect objects.

You could say that ObjectPath instance consists of two parts: direct path and indirect path. Direct path defines path to the currently comparing objects in relation to base objects. It could be empty, which would mean that currently comparing objects are base objects themselves. Base objects are the two indirect objects from the comparing documents which are in the same position in the pdf trees. Another part, indirect path, defines which indirect objects were met during comparison process to get to the current base objects. Indirect path is needed to avoid infinite loops during comparison.


Class CompareTool.ObjectPath.ArrayPathItem, constructor CompareTool.ObjectPath.ArrayPathItem(int)

Creates an instance of the ArrayPathItem. @param index the index which defines element of the PdfArray to which the transition was performed.
Class CompareTool.ObjectPath.ArrayPathItem, int getIndex()

The index which defines element of the PdfArray to which the transition was performed. See ArrayPathItem for more info. @return the index which defines element of the array to which the transition was performed

Class CompareTool.ObjectPath.DictPathItem, constructor CompareTool.ObjectPath.DictPathItem(PdfName)

Creates an instance of the DictPathItem. @param key the key which defines to which entry of the PdfDictionary the transition was performed.
Class CompareTool.ObjectPath.DictPathItem, PdfName getKey()

The key which defines to which entry of the PdfDictionary the transition was performed. See DictPathItem for more info. @return a PdfName which is the key which defines to which entry of the dictionary the transition was performed.

Class CompareTool.ObjectPath.IndirectPathItem, constructor CompareTool.ObjectPath.IndirectPathItem(PdfIndirectReference, PdfIndirectReference)

Creates IndirectPathItem instance for two corresponding objects from two comparing documents. @param cmpObject an object from the cmp document. @param outObject an object from the out document.

Class CompareTool.ObjectPath.LocalPathItem, Node toXmlNode(Document)

Creates an xml node that describes this direct path item. @param document xml document, to which this xml node will be added. @return an xml node describing direct path item.

Class CompareTool.ObjectPath.OffsetPathItem, constructor CompareTool.ObjectPath.OffsetPathItem(int)

Creates an instance of the OffsetPathItem. @param offset bytes offset to the specific position in PdfStream.
Class CompareTool.ObjectPath.OffsetPathItem, int getOffset()

The bytes offset of the stream which defines specific position in the PdfStream, to which transition was performed. @return an integer defining bytes offset to the specific position in stream.

Class CompareTool.ObjectPath, constructor CompareTool.ObjectPath(PdfIndirectReference, PdfIndirectReference)

Creates ObjectPath with corresponding base objects in two documents. @param baseCmpObject base object in cmp document. @param baseOutObject base object in out document.
Class CompareTool.ObjectPath, Stack getIndirectPath()

Gets indirect path which denotes sequence of the indirect references that were passed in comparing process to get to the current base objects. @return indirect path to the current base objects.
Class CompareTool.ObjectPath, Stack getLocalPath()

Gets local (or direct) path that denotes sequence of the path items from base object to the comparing direct object. @return direct path to the comparing object.
Class CompareTool.ObjectPath, boolean isComparing(PdfIndirectReference, PdfIndirectReference)

This method is used to define if given objects were already met in the path to the current base objects. If this method returns true it basically means that we found a loop in the objects structure and that we already compared these objects. @param cmpObject cmp object to check if it was already met in base objects path. @param outObject out object to check if it was already met in base objects path. @return true if given objects are contained in the path and therefore were already compared.
Class CompareTool.ObjectPath, void pushArrayItemToPath(int)

Adds array item to the direct path. See ArrayPathItem. @param index index in the array of the direct object to be compared.
Class CompareTool.ObjectPath, void pushDictItemToPath(PdfName)

Adds dictionary item to the direct path. See DictPathItem. @param key key in the dictionary to which corresponds direct object to be compared.
Class CompareTool.ObjectPath, void pushOffsetToPath(int)

Adds offset item to the direct path. See OffsetPathItem. @param offset offset to the specific byte in the stream that is compared.
Class CompareTool.ObjectPath, ObjectPath resetDirectPath(PdfIndirectReference, PdfIndirectReference)

Creates a new ObjectPath instance with two new given base objects, which are supposed to be nested in the base objects of the current instance of the ObjectPath. This method is used to avoid infinite loop in case of circular references in pdf documents objects structure.
Basically, this method creates copy of the current ObjectPath instance, but resets information of the direct paths, and also adds current ObjectPath instance base objects to the indirect references chain that denotes a path to the new base objects. @param baseCmpObject new base object in cmp document. @param baseOutObject new base object in out document. @return new ObjectPath instance, which stores chain of the indirect references which were already met to get to the new base objects.
Class CompareTool.ObjectPath, Node toXmlNode(Document)

Creates an xml node that describes a direct path stored in this ObjectPath instance. @param document xml document, to which this xml node will be added. @return an xml node describing direct path.

Class CompareTool, boolean compareArrays(PdfArray, PdfArray)

Simple method that compares two given PdfArrays by content. This is "deep" comparing, which means that all nested objects are also compared by content. @param outArray array to compare. @param cmpArray array to compare. @return true if arrays are equal by content, otherwise false. @throws IOException
Class CompareTool, boolean compareBooleans(PdfBoolean, PdfBoolean)

Simple method that compares two given PdfBooleans. @param outBoolean boolean to compare. @param cmpBoolean boolean to compare. @return true if booleans are equal, otherwise false.
Class CompareTool, CompareResult compareByCatalog(PdfDocument, PdfDocument)

Compares two PDF documents by content starting from Catalog dictionary and then recursively comparing corresponding objects which are referenced from it. You can roughly imagine it as depth-first traversal of the two trees that represent pdf objects structure of the documents.

The main difference between this method and the .compareByContent(String, String, String, String) methods is the return value. This method returns a CompareResult class instance, which could be used in code, however compareByContent methods in case of the differences simply return String value, which could only be printed. Also, keep in mind that this method doesn't perform visual comparison of the documents.

For more explanations about what is outDoc and cmpDoc see last paragraph of the CompareTool class description. @param outDocument the absolute path to the output file, which is to be compared to cmp-file. @param cmpDocument the absolute path to the cmp-file, which is to be compared to output file. @return the report of comparison of two files in the form of the custom class instance. See CompareResult for more info. @throws IOException
Class CompareTool, boolean compareDictionaries(PdfDictionary, PdfDictionary)

Simple method that compares two given PdfDictionaries by content. This is "deep" comparing, which means that all nested objects are also compared by content. @param outDict dictionary to compare. @param cmpDict dictionary to compare. @return true if dictionaries are equal by content, otherwise false. @throws IOException
Class CompareTool, String compareDocumentInfo(String, String)

Compares document info dictionaries of two pdf documents. @param outPdf the absolute path to the output file, which info is to be compared to cmp-file info. @param cmpPdf the absolute path to the cmp-file, which info is to be compared to output file info. @return text report of the differences in documents infos. @throws IOException
Class CompareTool, String compareDocumentInfo(String, String, byte[], byte[])

This method overload is used to compare two encrypted PDF documents. Document passwords are passed with outPass and cmpPass parameters.

Compares document info dictionaries of two pdf documents. @param outPdf the absolute path to the output file, which info is to be compared to cmp-file info. @param cmpPdf the absolute path to the cmp-file, which info is to be compared to output file info. @param outPass password for the encrypted document specified by the outPdf absolute path. @param cmpPass password for the encrypted document specified by the cmpPdf absolute path. @return text report of the differences in documents infos. @throws IOException
Class CompareTool, String compareLinkAnnotations(String, String)

Compares if two documents has identical link annotations on corresponding pages. @param outPdf the absolute path to the output file, which links are to be compared to cmp-file links. @param cmpPdf the absolute path to the cmp-file, which links are to be compared to output file links. @return text report of the differences in documents links. @throws IOException
Class CompareTool, boolean compareNames(PdfName, PdfName)

Simple method that compares two given PdfNames. @param outName name to compare. @param cmpName name to compare. @return true if names are equal, otherwise false.
Class CompareTool, boolean compareNumbers(PdfNumber, PdfNumber)

Simple method that compares two given PdfNumbers. @param outNumber number to compare. @param cmpNumber number to compare. @return true if numbers are equal, otherwise false.
Class CompareTool, boolean compareStreams(PdfStream, PdfStream)

Simple method that compares two given PdfStreams by content. This is "deep" comparing, which means that all nested objects are also compared by content. @param outStream stream to compare. @param cmpStream stream to compare. @return true if stream are equal by content, otherwise false. @throws IOException
Class CompareTool, boolean compareStrings(PdfString, PdfString)

Simple method that compares two given PdfStrings. @param outString string to compare. @param cmpString string to compare. @return true if strings are equal, otherwise false.
Class CompareTool, String compareTagStructures(String, String)

Compares tag structures of the two PDF documents.
This method creates xml files in the same folder with outPdf file. These xml files contain documents tag structures converted into the xml structure. These xml files are compared if they are equal. @param outPdf the absolute path to the output file, which tags are to be compared to cmp-file tags. @param cmpPdf the absolute path to the cmp-file, which tags are to be compared to output file tags. @return text report of the differences in documents tags. @throws IOException @throws ParserConfigurationException @throws SAXException
Class CompareTool, String compareVisually(String, String, String, String)

Compares two documents visually. For the comparison two external tools are used: Ghostscript and ImageMagick. For more info about needed configuration for visual comparison process see CompareTool class description.
During comparison for every page of two documents an image file will be created in the folder specified by outPath absolute path. Then those page images will be compared and if there are any differences for some pages, another image file will be created with marked differences on it. @param outPdf the absolute path to the output file, which is to be compared to cmp-file. @param cmpPdf the absolute path to the cmp-file, which is to be compared to output file. @param outPath the absolute path to the folder, which will be used to store image files for visual comparison. @param differenceImagePrefix file name prefix for image files with marked differences if there is any. @return string containing list of the pages that are visually different, or null if there are no visual differences. @throws InterruptedException @throws IOException
Class CompareTool, String compareVisually(String, String, String, String, Map>)

Compares two documents visually. For the comparison two external tools are used: Ghostscript and ImageMagick. For more info about needed configuration for visual comparison process see CompareTool class description.
During comparison for every page of two documents an image file will be created in the folder specified by outPath absolute path. Then those page images will be compared and if there are any differences for some pages, another image file will be created with marked differences on it.
It is possible to ignore certain areas of the document pages during visual comparison. This is useful for example in case if documents should be the same except certain page area with date on it. In this case, in the folder specified by the outPath, new pdf documents will be created with the black rectangles at the specified ignored areas, and visual comparison will be performed on these new documents. @param outPdf the absolute path to the output file, which is to be compared to cmp-file. @param cmpPdf the absolute path to the cmp-file, which is to be compared to output file. @param outPath the absolute path to the folder, which will be used to store image files for visual comparison. @param differenceImagePrefix file name prefix for image files with marked differences if there is any. @param ignoredAreas a map with one-based page numbers as keys and lists of ignored rectangles as values. @return string containing list of the pages that are visually different, or null if there are no visual differences. @throws InterruptedException @throws IOException
Class CompareTool, boolean compareXmls(String, String)

Utility method that provides simple comparison of the two xml files. @param xmlFilePath1 absolute path to the first xml file to compare. @param xmlFilePath2 absolute path to the second xml file to compare. @return true if xml structures are identical, false otherwise. @throws ParserConfigurationException @throws SAXException @throws IOException
Class CompareTool, boolean compareXmls(byte[], byte[])

Utility method that provides simple comparison of the two xml files stored in byte arrays. @param xml1 first xml file data to compare. @param xml2 second xml file data to compare. @return true if xml structures are identical, false otherwise. @throws ParserConfigurationException @throws SAXException @throws IOException
Class CompareTool, String compareXmp(String, String)

Compares xmp metadata of the two given PDF documents. @param outPdf the absolute path to the output file, which xmp is to be compared to cmp-file. @param cmpPdf the absolute path to the cmp-file, which xmp is to be compared to output file. @return text report of the xmp differences, or null if there are no differences.
Class CompareTool, String compareXmp(String, String, boolean)

Compares xmp metadata of the two given PDF documents. @param outPdf the absolute path to the output file, which xmp is to be compared to cmp-file. @param cmpPdf the absolute path to the cmp-file, which xmp is to be compared to output file. @param ignoreDateAndProducerProperties true, if to ignore differences in date or producer xmp metadata properties. @return text report of the xmp differences, or null if there are no differences.
Class CompareTool, CompareTool disableCachedPagesComparison()

Disables the default logic of pages comparison. This option makes sense only for CompareTool.compareByCatalog(PdfDocument, PdfDocument) method.

By default, pages are treated as special objects and if they are met in the process of comparison, then they are not checked as objects, but rather simply checked that they has same page numbers in both documents. This behaviour is intended for the CompareTool.compareByContent set of methods, because in them documents are compared in page by page basis. Thus, we don't need to check if pages are of the same content when they are met in comparison process, we are sure that we will compare their content or we have already compared them.

However, if you would use CompareTool.compareByCatalog with default behaviour of pages comparison, pages won't be checked at all, every time when reference to the page dictionary is met, only page numbers will be compared for both documents. You can say that in this case, comparison will be performed for all document's catalog entries except /Pages (However in fact, document's page tree structures will be compared, but pages themselves - won't). @return this CompareTool instance.

Class CompareTool, CompareTool enableEncryptionCompare()

Enables the comparison of the encryption properties of the documents. Encryption properties comparison results are returned along with all other comparison results.
IMPORTANT NOTE: this flag affect only the comparison made by compareByContent methods! @return this CompareTool instance.
Class CompareTool, ReaderProperties getCmpReaderProperties()

Documents for comparison are opened in reader mode. This method is intended to alter ReaderProperties which are used to open cmp document. This is particularly useful for comparison of encrypted documents.

For more explanations about what is outDoc and cmpDoc see last paragraph of the CompareTool class description. @return ReaderProperties instance which will be later passed to the cmp document PdfReader.

Class CompareTool, ReaderProperties getOutReaderProperties()

Documents for comparison are opened in reader mode. This method is intended to alter ReaderProperties which are used to open output document. This is particularly useful for comparison of encrypted documents.

For more explanations about what is outDoc and cmpDoc see last paragraph of the CompareTool class description. @return ReaderProperties instance which will be later passed to the output document PdfReader.

Class CompareTool, CompareTool setCompareByContentErrorsLimit(int)

Sets the maximum errors count which will be returned as the result of the comparison. @param compareByContentMaxErrorCount the errors count. @return this CompareTool instance.
Class CompareTool, CompareTool setGenerateCompareByContentXmlReport(boolean)

Enables or disables the generation of the comparison report in the form of the xml document.
IMPORTANT NOTE: this flag affect only the comparison made by compareByContent methods! @param generateCompareByContentXmlReport true to enable xml report generation, false - to disable. @return this CompareTool instance.