Foxit PDF SDK
foxit::addon::comparison::Comparison Class Reference
Inheritance diagram for foxit::addon::comparison::Comparison:
foxit::Base

Public Types

enum  CompareType { e_CompareTypeAll = 0x00000000, e_CompareTypeText = 0x00000001 }
 Enumeration for compare type flags. More...
 

Public Member Functions

 Comparison (const pdf::PDFDoc &base_doc, const pdf::PDFDoc &compared_doc)
 Constructor, from PDF document object. More...
 
 Comparison (const Comparison &other)
 Constructor, with another comparison object. More...
 
 ~Comparison ()
 Destructor.
 
CompareResults DoCompare (int base_page_index, int compared_page_index, foxit::uint32 compare_flags)
 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 aredused to construct current object. More...
 
pdf::PDFDoc GenerateComparedDoc (foxit::uint32 compare_flags)
 Compare the base document with compared document (which are used to construct current object) and then generate a PDF document as comparison result. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool operator!= (const Comparison &other) const
 Not equal operator. More...
 
Comparisonoperator= (const Comparison &other)
 Assign operator. More...
 
bool operator== (const Comparison &other) const
 Equal operator. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

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.

Member Enumeration Documentation

◆ CompareType

Enumeration for compare type flags.

Values of this enumeration can be used alone and some values can be used in combination.

Enumerator
e_CompareTypeAll 

Compare all content. This value should be used alone.

e_CompareTypeText 

Compare text only.

Constructor & Destructor Documentation

◆ Comparison() [1/2]

foxit::addon::comparison::Comparison::Comparison ( const pdf::PDFDoc base_doc,
const pdf::PDFDoc compared_doc 
)
explicit

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 foxit::e_ErrInvalidLicense.

◆ Comparison() [2/2]

foxit::addon::comparison::Comparison::Comparison ( const Comparison other)

Constructor, with another comparison object.

Parameters
[in]otherAnother comparison object.

Member Function Documentation

◆ DoCompare()

CompareResults foxit::addon::comparison::Comparison::DoCompare ( int  base_page_index,
int  compared_page_index,
foxit::uint32  compare_flags 
)

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 aredused 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 Comparison::e_CompareTypeAll and this can be one or combination of some of these values.
Returns
A comparison::CompareResults object.

◆ GenerateComparedDoc()

pdf::PDFDoc foxit::addon::comparison::Comparison::GenerateComparedDoc ( foxit::uint32  compare_flags)

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

It may take a long time to compare content of two PDF documents and generate the new PDF document.

Parameters
[in]compare_flagsCompare type which specifies what to be compared in PDF pages. Please refer to values starting from Comparison::e_CompareTypeAll and this can be one or combination of some of these values.
Returns
A pdf::PDFDoc object which represents the PDF document as comparison result.

◆ IsEmpty()

bool foxit::addon::comparison::Comparison::IsEmpty ( ) const

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.

◆ operator!=()

bool foxit::addon::comparison::Comparison::operator!= ( const Comparison other) const

Not equal operator.

Parameters
[in]otherAnother comparison object. This function will check if current object is not equal to this one.
Returns
true means not equal, while false means equal.

◆ operator=()

Comparison& foxit::addon::comparison::Comparison::operator= ( const Comparison other)

Assign operator.

Parameters
[in]otherAnother comparison object, whose value would be assigned to current object.
Returns
Reference to current object itself.

◆ operator==()

bool foxit::addon::comparison::Comparison::operator== ( const Comparison other) const

Equal operator.

Parameters
[in]otherAnother comparison object. This function will check if current object is equal to this one.
Returns
true means equal, while false means not equal.