跳轉到主要內容
本主題適用於 Windows 版 FRE。
本節旨在協助您將使用 ABBYY ScanDifFinder SDK 的程式碼升級至 ABBYY FineReader Engine 中實作的全新 Document Comparison API。 ABBYY ScanDifFinder SDK:
  • 使用內建識別機制處理文件
  • 將檔案與其副本進行比較,並將結果儲存為頁面圖像
搭配 Document Comparison API 的 ABBYY FineReader Engine:
  • 使用 ABBYY FineReader Engine 的完整方法集,為文件比較做好準備
  • 需要使用已透過 ABBYY FineReader Engine 識別的文件或頁面
  • 將文件或選定的頁面範圍與其副本進行比較,並將結果匯出為 XML 或 DOCX 格式
在此版本中,Document Comparison API 不支援以下功能: 此物件將於未來版本中提供支援。

範例

ABBYY ScanDifFinder SDK 與 Document Comparison API 採用截然不同的方式來比較文件。以下範例說明了兩者的差異。 ABBYY ScanDifFinder SDK 程式碼範例
//指定要比較的文件路徑,
//以及比較結果的輸出路徑
 
try
{
    string refFile = Path.GetFullPath( args[0] );
    string userFile = Path.GetFullPath( args[1] );
    ScanDifFinder difFinder = new ScanDifFinder();
    difFinder.TempDir = tempDir;
    ProcessFiles( difFinder, refFile, userFile );
}
catch (Exception)
{
}
finally
{
    if (Directory.Exists( tempDir ))
    Directory.Delete( tempDir, true );
}
Document Comparison API 範例
// 對參考文件執行完整處理
FREngine.FRDocument referenceFRDocument = engine.CreateFRDocument();
referenceFRDocument.AddImageFile( "C:\\ReferenceDocument.pdf", null, null );
referenceFRDocument.Process( dpParams );
// 對使用者文件執行完整處理
FREngine.FRDocument userFRDocument = engine.CreateFRDocument();
userFRDocument.AddImageFile( "C:\\UserDocument.pdf", null, null );
userFRDocument.Process( dpParams );
// 執行比較
FREngine.IComparator comparator = engineLoader.Engine.CreateComparator();
FREngine.IComparisonResult comparisonResult = 
    comparator.CompareDocuments( referenceFRDocument, userFRDocument, null, null );
FREngine.IChanges changes = comparisonResult.Changes;
// 處理比較結果
foreach (FREngine.IChange change in changes)
{
FREngine.IChangeLocation userLocation = change.UserLocation;
FREngine.IChangePosition userChangeStartPosition = userLocation.StartPosition;
FREngine.IChangePosition userChangeEndPosition = userLocation.EndPosition;
}
// 將結果匯出為指定格式的文件
comparisonResult.Export( "C:\\ComparisonResult.xml", FREngine.ComparatorExportFormatEnum.CEF_Xml, null );

API 比較

下表說明 ABBYY FineReader Engine 中可取代 ABBYY ScanDifFinder SDK 方法與屬性的方法和屬性。


請改用物件 作為文件或頁面比較的主要物件。

文件比較請使用方法,頁面比較請使用方法。

儲存影像須透過 ABBYY FineReader Engine 的方法執行,例如使用方法 (屬於物件) 。

請使用物件的方法。

請改用物件的屬性。

Document Comparison API 的授權透過 ABBYY FineReader Engine 管理 (請參閱 授權) 。

請使用方法指定 ABBYY FineReader Engine 暫存檔案資料夾的路徑及其他額外參數。


請改用物件。若要取得原始文件或頁面與其副本的比較結果,請使用方法。若要將結果匯出至檔案,請使用方法。

請改用物件,以取得文件比較過程中偵測到的所有變更清單。

請使用物件的屬性取得文件的頁數。


Use the物件,用來表示原始文件與其副本之間的一項差異。該方法可協助您取得文件文字中的變更。

請改用and theproperties of the物件上的這些屬性。這些屬性會回傳變更內容的類型,以及所做修改的種類等資訊。

請改用property of the物件的屬性。

請改用property of the物件的屬性。

請改用property of the物件的屬性。

請改用property of the物件的屬性。


Use the物件,以取得單一變更的相關資訊。

由於 Document Comparison API 採用不同的邏輯結構,因此此屬性已移除。

請改用property of the物件的屬性。

由於 Document Comparison API 採用不同的邏輯結構,因此這些屬性已移除。


請改用物件,以取得變更位置的相關資訊。

請改用property of the物件的屬性。此屬性會回傳指定頁面上的變更區域。


請改用物件。

請改用物件的屬性 (已設為 CRM_DoNotReuse) 。此屬性指定如何使用來源 PDF 檔案的文字與影像圖層。

請改用物件的屬性。

UseDoubleLanguageAgreementMode 目前尚未實作。

請使用物件的方法。

此屬性已移除,因為 Document Comparison API 採用不同的邏輯結構。

請改用物件的屬性。此屬性指定是否須在版面分析與識別之前,從影像中濾除色彩物件。

請改用物件的屬性。

請改用物件的屬性。

請改用物件的屬性。

請改用物件的屬性。

此屬性已修改,現在執行不同的功能 (請參閱物件的屬性) 。

此屬性已移除,因為 Document Comparison API 採用不同的邏輯結構。

影像儲存作業透過 ABBYY FineReader Engine 方法執行,例如使用物件的方法。

使用物件的方法。


請改用。這些列舉分別指定對文件內容所做的修改類型,以及已變更內容的類型。


儲存影像須使用 ABBYY FineReader Engine 的方法,例如物件的方法。

另請參見

文件比較物件