Foxit PDF SDK
com.foxit.sdk.addon.comparison.Comparison Class Reference
Inheritance diagram for com.foxit.sdk.addon.comparison.Comparison:
com.foxit.sdk.common.Base

Public Member Functions

 Comparison (Comparison other)
 Constructor, with another comparison object.
More...
 
 Comparison (PDFDoc base_doc, PDFDoc compared_doc) throws com.foxit.sdk.PDFException
 Constructor, from PDF document object.
More...
 
synchronized void delete ()
 Clean up related resources immediately. More...
 
CompareResults doCompare (int base_page_index, int compared_page_index, int compare_flags) throws com.foxit.sdk.PDFException
 Compare a PDF page of base document with a PDF page in compared document. "base document" and "compared document" means the PDF documents objects that are used to construct current object.
More...
 
PDFDoc generateComparedDoc (int compare_flags) throws com.foxit.sdk.PDFException
 Compare the base document with the compared document (which are used to construct current object) and then generate a PDF document as the comparison result.
More...
 
PDFDoc generateComparedDoc (int compare_flags, boolean is_show_all_layers) throws com.foxit.sdk.PDFException
 Compare the base document with the compared document (which are used to construct current object) and then generate a PDF document as the comparison result.
More...
 
boolean isEmpty ()
 Check whether current object is empty or not.
More...
 

Static Public Attributes

static final int e_CompareTypeAll = 0x00000000
 Compare all content. This value should be used alone.

 
static final int e_CompareTypeAnnotation = 0x00000002
 Compare annotation only.

 
static final int e_CompareTypeText = 0x00000001
 Compare text only.

 

Detailed Description

This class can be used to compare one PDF file (as "base document") with another PDF file (as "compared document") page by page.

Constructor & Destructor Documentation

◆ Comparison() [1/2]

com.foxit.sdk.addon.comparison.Comparison.Comparison ( PDFDoc  base_doc,
PDFDoc  compared_doc 
) throws com.foxit.sdk.PDFException

Constructor, from PDF document object.

Parameters
[in]base_docA valid PDF document object as base document.
[in]compared_docA valid PDF document object as compared document.
Note
If module "Comparison" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using compare related functions and this constructor will throw exception com.foxit.sdk.common.Constants.e_ErrNoComparisonModuleRight .

◆ Comparison() [2/2]

com.foxit.sdk.addon.comparison.Comparison.Comparison ( Comparison  other)

Constructor, with another comparison object.

Parameters
[in]otherAnother comparison object.

Member Function Documentation

◆ delete()

synchronized void com.foxit.sdk.addon.comparison.Comparison.delete ( )

Clean up related resources immediately.

Returns
None.
Note
Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

◆ doCompare()

CompareResults com.foxit.sdk.addon.comparison.Comparison.doCompare ( int  base_page_index,
int  compared_page_index,
int  compare_flags 
) throws com.foxit.sdk.PDFException

Compare a PDF page of base document with a PDF page in compared document. "base document" and "compared document" means the PDF documents objects that are used to construct current object.

Parameters
[in]base_page_indexPage index in base document. Valid range: from 0 to (base_page_count-1). base_page_count is returned by function pdf.PDFDoc.getPageCount for base document.
[in]compared_page_indexPage index in compared document. Valid range: from 0 to (compared_page_count-1). compared_page_count is returned by function pdf.PDFDoc.getPageCount for compared document.
[in]compare_flagsCompare type which specifies what to be compared in PDF pages. Please refer to values starting from com.foxit.sdk.addon.comparison.Comparison.e_CompareTypeAll and this can be one or combination of some of these values.
Returns
A com.foxit.sdk.addon.comparison.CompareResults object.

◆ generateComparedDoc() [1/2]

PDFDoc com.foxit.sdk.addon.comparison.Comparison.generateComparedDoc ( int  compare_flags) throws com.foxit.sdk.PDFException

Compare the base document with the compared document (which are used to construct current object) and then generate a PDF document as the comparison result.

Comparing the contents of two PDF documents and generating a new PDF document can take a long time.

Parameters
[in]compare_flagsCompare type which specifies what to be compared in PDF pages. Please refer to values starting from com.foxit.sdk.addon.comparison.Comparison.e_CompareTypeAll and this can be one or a combination of these values.
Returns
A com.foxit.sdk.pdf.PDFDoc object which represents the output comparison PDF document.

◆ generateComparedDoc() [2/2]

PDFDoc com.foxit.sdk.addon.comparison.Comparison.generateComparedDoc ( int  compare_flags,
boolean  is_show_all_layers 
) throws com.foxit.sdk.PDFException

Compare the base document with the compared document (which are used to construct current object) and then generate a PDF document as the comparison result.

Comparing the contents of two PDF documents and generating a new PDF document can take a long time.

Parameters
[in]compare_flagsCompare type which specifies what to be compared in PDF pages. Please refer to values starting from com.foxit.sdk.addon.comparison.Comparison.e_CompareTypeAll and this can be one or a combination of these values.
[in]is_show_all_layersA boolean value used to decide whether to show all comparison result layers or not. true means that all comparison result layers are shown by default, while false means only "Text" and "Images" comparison result layers are shown by default.
Returns
A com.foxit.sdk.pdf.PDFDoc object which represents the output comparison PDF document.

◆ isEmpty()

boolean com.foxit.sdk.addon.comparison.Comparison.isEmpty ( )

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.