使用Dart比較兩個DOC

高度準確的Dart差異檢查器比較DOC文件並發現它們之間的差異

我們強大的Dart SDK可讓您找到DOC文檔之間的差異並將結果保存為方便查看的格式。要驗證我們的產品功能,請使用此Dart庫比較DOC文件並查看差異。

看程式碼片段

比較 Dart 中的 DOC

我們的 Dart/Flutter SDK 旨在為您提供最準確的結果,即使比較本身就是一個複雜的功能。

有時你需要確定 DOC 格式的文檔沒有被改變,如果有,你需要找出有什麼不同。只需使用我們的 Dart/Flutter diff 工具來比較兩個 DOC 文件並查找整個單詞或單個字符的差異。此外,如果一個單詞中只有一個字符發生了變化,則該單詞將被標記為完全更改。

現在,您不再需要花時間手動比較 DOC 文檔,您可以快速找到哪怕是很小的更改,並以方便的格式將此類差異導出到文檔中。

嘗試比較 DOC 文檔

查看我們使用 Dart/Flutter SDK 比較 DOC 文件的解決方案如何工作。為此,加載要比較的 DOC 文件並選擇導出文件格式 - 比較後會自動加載。

請注意,在調用比較方法之前,您需要接受比較文檔中的所有修訂,如我們的示例所示:

上傳比較文件
運行代碼
上傳第二個文件進行比較
從列表中選擇目標格式
import 'package:aspose_words_cloud/aspose_words_cloud.dart';

final config = Configuration("####-####-####-####-####", "##################");
final wordsApi = WordsApi(config);

final fileName1 = 'Input1.doc';
final fileName2 = 'Input2.doc';
final fileResult = 'Output.doc';

// 將文檔上傳到雲存儲。
final firstDocumentContent = (await File(fileName1).readAsBytes()).buffer.asByteData();
final uploadFirstFileRequest = UploadFileRequest(firstDocumentContent, fileName1);
await wordsApi.uploadFile(uploadFirstFileRequest);

final secondDocumentContent = (await File(fileName2).readAsBytes()).buffer.asByteData();
final uploadSecondFileRequest = UploadFileRequest(secondDocumentContent, fileName2);
await wordsApi.uploadFile(uploadSecondFileRequest);

// 比較雲中的文檔。
final compareDataOptions = CompareData();
compareDataOptions.author = 'author';
compareDataOptions.comparingWithDocument = fileName2;
final compareDocumentRequest = 
    CompareDocumentRequest(fileName1, compareDataOptions, destFileName: fileResult);
await wordsApi.compareDocument(compareDocumentRequest);

// 從雲存儲下載結果文檔。
final downloadFileRequest = DownloadFileRequest(fileResult);
final downloadFileResult = await wordsApi.downloadFile(downloadFileRequest);
await File('compareResult.pdf').writeAsBytes(
    downloadFileResult.buffer.asUint8List(
	downloadFileResult.offsetInBytes, downloadFileResult.lengthInBytes)
運行代碼
  
將代碼Dart複製到剪貼板

如何比較兩個文本文件

  1. Aspose.Words Cloud for Dart/Flutter
  2. 將庫引用(導入庫)添加到您的Dart項目
  3. 加載兩個DOC文檔以進行比較
  4. 調用compareDocument()方法來比較DOC文檔
  5. 從雲存儲下載結果文檔

Dart庫使用比較

從 GitHub 克隆 Aspose.Words Cloud SDK for Dart 源代碼並在您的項目中使用它。將此依賴項添加到您的 pubspec.yaml: dependencies: aspose_words_cloud: 22.4.0

請按照這些 Instructions 快速獲取必要的安全憑證並訪問我們的 REST API。

系統要求

請參閱 Repository Documentation 以查看詳細信息。

其他支持的文件格式

您可以對其他文件格式執行比較操作:

5%

訂閱 Aspose 產品更新

獲取直接發送到您的郵箱的每月通訊和優惠。

© Aspose Pty Ltd 2001-2024. 版權所有。