Bandhingake rong DOCX nggunakake Go

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

Go 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 Go iki lan deleng bedane.

Ndeleng potongan kode

Bandhingake DOCX ing Go

Kita Go 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 Go 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 Go 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 (
    "os"
    "github.com/aspose-words-cloud/aspose-words-cloud-go/dev/api/models"
)

config, _ := models.NewConfiguration("config.json")
wordsApi, ctx, _ := api.CreateWordsApi(config)

fileName1:= "Input1.docx"
fileName2:= "Input2.docx"
fileResult:= "Output.docx"

//  Upload dokumen menyang panyimpenan maya.
firstDocumentContent, _ := os.Open(fileName1)
uploadFirstFileRequestOptions := map[string]interface{}{}
uploadFirstFileRequest := &models.UploadFileRequest{
    FileContent: firstDocumentContent,
    Path: ToStringPointer(fileName1),
    Optionals: uploadFirstFileRequestOptions,
}
_, _, _ = wordsApi.UploadFile(ctx, uploadFirstFileRequest)

secondDocumentContent, _ := os.Open(fileName2)
uploadSecondFileRequestOptions := map[string]interface{}{}
uploadSecondFileRequest := &models.UploadFileRequest{
    FileContent: secondDocumentContent,
    Path: ToStringPointer(fileName2),
    Optionals: uploadSecondFileRequestOptions,
}
_, _, _ = wordsApi.UploadFile(ctx, uploadSecondFileRequest)

//  Mbandhingake dokumen ing awan.
compareDataOptions := models.CompareData{
    Author: ToStringPointer("author"),
    FileReference: models.CreateRemoteFileReference(fileName2),
}
compareDocumentRequestOptions := map[string]interface{}{"destFileName": fileResult,}
compareDocumentRequest := &models.CompareDocumentRequest{
    Name: ToStringPointer(fileName1),
    CompareData: &compareDataOptions,
    Optionals: compareDocumentRequestOptions,
}
_, _, _ = wordsApi.CompareDocument(ctx, compareDocumentRequest)

//  Download dokumen asil saka panyimpenan maya.
downloadFileRequestOptions := map[string]interface{}{}
downloadFileRequest := &models.DownloadFileRequest{
    Path: ToStringPointer(fileResult),
    Optionals: downloadFileRequestOptions,
}
_, _ = wordsApi.DownloadFile(ctx, downloadFileRequest)
Kode roto
  
Nyalin kode Go menyang clipboard

Cara mbandhingake rong file teks

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

Go perpustakaan kanggo nggunakake mbandhingake

Run go get -v github.com/aspose-words-cloud/aspose-words-cloud-go/2007/api kanggo nginstal Aspose.Words Cloud SDK for Go. Sampeyan bisa entuk akeh informasi migunani babagan cara instalasi liyane saka bagean "How to use SDK".

Klone Aspose.Words Cloud SDK for Go saka GitHub lan gunakake ing proyek sampeyan. 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.