Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
FoxitPDFSDKPython2.Comparison Class Reference
Inheritance diagram for FoxitPDFSDKPython2.Comparison:

## Public Member Functions
def | Comparison (base_doc, compared_doc)
| Constructor, from PDF document object. More...
def | Comparison (other)
| Constructor, with another comparison object. More...
def | DoCompare (base_page_index, compared_page_index, 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 are used to construct current object. More...
def | GenerateComparedDoc (compare_flags)
| 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...
def | IsEmpty ()
| Check whether current object is empty or not. More...

## Static Public Attributes
| e_CompareTypeAll = _fsdk.Comparison_e_CompareTypeAll
| Compare all content. This value should be used alone.
| e_CompareTypeAnnotation = _fsdk.Comparison_e_CompareTypeAnnotation
| Compare annotation only.
| e_CompareTypeText = _fsdk.Comparison_e_CompareTypeText
| 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]

def FoxitPDFSDKPython2.Comparison.Comparison | ( |  | base_doc,
|  |  | compared_doc
| ) |  |

Constructor, from PDF document object.

Parameters

  [in] | base_doc | A valid PDF document object as base document.
  [in] | compared_doc | A valid PDF document object as compared document.

Note
  If module "Comparison" is not defined in the license information which is used in function FoxitPDFSDKPython2.Library.Initialize , that means user has no right in using compare related functions and this constructor will throw exception FoxitPDFSDKPython2.e_ErrNoComparisonModuleRight .

## ◆ Comparison() [2/2]

def FoxitPDFSDKPython2.Comparison.Comparison | ( |  | other | ) |

Constructor, with another comparison object.

Parameters

  [in] | other | Another comparison object.

## Member Function Documentation

## ◆ DoCompare()

def FoxitPDFSDKPython2.Comparison.DoCompare | ( |  | base_page_index,
|  |  | compared_page_index,
|  |  | 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 are used to construct current object.

Parameters

  [in] | base_page_index | Page index in base document. Valid range: from 0 to (base_page_count-1). base_page_count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount for base document.
  [in] | compared_page_index | Page index in compared document. Valid range: from 0 to (compared_page_count-1). compared_page_count is returned by function FoxitPDFSDKPython2.PDFDoc.GetPageCount for compared document.
  [in] | compare_flags | Compare type which specifies what to be compared in PDF pages. Please refer to values starting from FoxitPDFSDKPython2.Comparison.e_CompareTypeAll and this can be one or combination of some of these values.

Returns
  A FoxitPDFSDKPython2.CompareResults object.

## ◆ GenerateComparedDoc()

def FoxitPDFSDKPython2.Comparison.GenerateComparedDoc | ( |  | compare_flags | ) |

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_flags | Compare type which specifies what to be compared in PDF pages. Please refer to values starting from FoxitPDFSDKPython2.Comparison.e_CompareTypeAll and this can be one or a combination of these values.

Returns
  A FoxitPDFSDKPython2.PDFDoc object which represents the output comparison PDF document.

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

Parameters

  [in] | compare_flags | Compare type which specifies what to be compared in PDF pages. Please refer to values starting from FoxitPDFSDKPython2.Comparison.e_CompareTypeAll and this can be one or a combination of these values.
  [in] | is_show_all_layers | A 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 FoxitPDFSDKPython2.PDFDoc object which represents the output comparison PDF document.

## ◆ IsEmpty()

def FoxitPDFSDKPython2.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.