ComparePageTextsWith

Page manipulation

Requires the Small Business edition — in Delphi, C++Builder and Lazarus code create the library as TPDFlibSmallBusiness (unit PDFlibSmallBusiness) or TPDFlibEnterprise; the Small Business and Enterprise DLL and ActiveX builds provide it unchanged; the Single edition keeps the method, which returns 0 and sets LastErrorCode to 901 (PDFLIB_ERROR_SMALLBUSINESS_REQUIRED)

Description

Compares two documents page by page on extracted text

Syntax

Delphi

Function ComparePageTextsWith(Other: TPDFlib; Out FirstDifferentPage, ThisPageCount, OtherPageCount: Integer): Integer; Virtual;

ActiveX

Function PDFlib::ComparePageTextsWith(Other As Object, ByRef FirstDifferentPage As Long, ByRef ThisPageCount As Long, ByRef OtherPageCount As Long) As Long

DLL

int DLComparePageTextsWith(int InstanceID, int OtherInstanceID, int* FirstDifferentPage, int* ThisPageCount, int* OtherPageCount);

Parameters

OtherThe second document, loaded in its own library instance. The DLL and the Dylib take the instance handle DLCreateLibrary returned for it as OtherInstanceID; Automation takes the other control object
FirstDifferentPageFirst page whose text differs, or 0 when all shared pages match
ThisPageCount, OtherPageCountThe page counts of both documents

Return values

The number of pages whose extracted text differs; differing page counts surface through the count parameters

Remarks

Comparison uses raw extraction (option 8) so whitespace layout influences the result

See also

GetPageText, ComparePreflightReports