Bandhingake rong DOCX nggunakake Java

Pemeriksa beda Java sing akurat banget kanggo mbandhingake DOCX file lan nemokake bedane

Java SDK kita sing kuat ngidini sampeyan nemokake prabédan antarane DOCX dokumen lan nyimpen asil menyang format sing trep kanggo dideleng. Kanggo verifikasi kemampuan produk, mbandhingake DOCX file nggunakake perpustakaan Java iki lan deleng bedane.

Ndeleng potongan kode

Bandhingake DOCX ing Java

Kita Java SDK dirancang kanggo menehi asil sing paling akurat, sanajan perbandingan minangka fungsi sing kompleks.

Kadhangkala sampeyan kudu mesthekake yen dokumen ing DOCX format durung diganti, lan yen wis, sampeyan kudu ngerteni apa bedane. Cukup gunakake alat diff Java kanggo mbandhingake rong DOCX file lan temokake bedane kabeh tembung utawa karakter tunggal. Kajaba iku, yen mung siji karakter ing tembung sing diganti, tembung iki bakal ditandhani minangka diganti kabeh.

Saiki sampeyan ora perlu maneh nglampahi wektu kanthi manual mbandhingake DOCX dokumen, lan sampeyan bisa kanthi cepet nemokake owah-owahan cilik lan ngekspor bedane kasebut menyang dokumen kanthi format sing trep.

Coba mbandhingake DOCX dokumen

Priksa kepiye solusi kanggo mbandhingake DOCX file nggunakake Java SDK. Kanggo entuk iki, muat DOCX file sing pengin dibandhingake lan pilih format file ekspor - bakal dimuat kanthi otomatis sawise mbandhingake.

Elinga yen sampeyan kudu nampa kabeh revisi ing dokumen sing dibandhingake sadurunge nelpon metode perbandingan, kaya sing ditampilake ing conto kita:

Unggah file sing dibandhingake
Kode roto
Unggah file kapindho kanggo mbandhingake
Pilih format target saka dhaptar
import com.aspose.words.cloud.*;

ApiClient apiClient = new ApiClient("####-####-####-####-####", "##################", null);
WordsApi wordsApi = new WordsApi(apiClient);

String fileName1 = "Input1.docx";
String fileName2 = "Input2.docx";
String fileResult = "Output.docx";

//  Upload dokumen menyang panyimpenan maya.
byte[] firstDocumentContent = Files.readAllBytes(Paths.get(fileName1).toAbsolutePath());
UploadFileRequest uploadFirstFileRequest =
    new UploadFileRequest(firstDocumentContent, fileName1, null);
wordsApi.uploadFile(uploadFirstFileRequest);

byte[] secondDocumentContent = Files.readAllBytes(Paths.get(fileName2).toAbsolutePath());
UploadFileRequest uploadSecondFileRequest =
    new UploadFileRequest(secondDocumentContent, fileName2, null);
wordsApi.uploadFile(uploadSecondFileRequest);

//  Mbandhingake dokumen ing awan.
CompareData compareDataOptions = new CompareData();
compareDataOptions.setAuthor("author");
compareDataOptions.setFileReference(new FileReference(fileName2));

CompareDocumentRequest compareDocumentRequest =
    new CompareDocumentRequest(fileName1, compareDataOptions,
	null, null, null, null, null, fileResult, null);
wordsApi.compareDocument(compareDocumentRequest);

//  Download dokumen asil saka panyimpenan maya.
DownloadFileRequest downloadFileRequest = new DownloadFileRequest(fileResult, null, null);
byte[] downloadFileResult = wordsApi.downloadFile(downloadFileRequest);
Files.write(Paths.get(fileResult), downloadFileResult.values().iterator().next());
Kode roto
  
Nyalin kode Java menyang clipboard

Cara mbandhingake rong file teks

  1. Pasang Aspose.Words Cloud for Java
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek Java sampeyan
  3. Muat rong DOCX dokumen kanggo mbandhingake
  4. Telpon metode compareDocument() kanggo mbandhingake DOCX docs
  5. Download dokumen asil saka panyimpenan maya

Java perpustakaan kanggo nggunakake mbandhingake

Instal 'Aspose.Words Cloud SDK for Java' nggunakake alat otomatisasi mbangun Maven.

Tambah ketergantungan iki menyang POM proyek sampeyan: aspose-cloud artifact.aspose-cloud-releases http://artifact.aspose.cloud/repo com.aspose aspose-words-cloud 22.4.0

Minangka alternatif, sampeyan bisa clone Aspose.Words Cloud SDK for Java saka GitHub lan nggunakake ing project. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.

Requirements Sistem

Deleng Repository Documentation kanggo ndeleng rincian.

Format file liyane sing didhukung

Sampeyan bisa nindakake operasi mbandhingake kanggo format file liyane:

5%

Langganan kanggo Aspose Update Product

Entuk buletin saben wulan lan tawaran langsung dikirim menyang kothak layang.

© Aspose Pty Ltd 2001-2024. Kabeh hak dilindhungi undhang-undhang.