Bandhingake rong HTML nggunakake Swift

Pemeriksa beda Swift sing akurat banget kanggo mbandhingake HTML file lan nemokake bedane

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

Ndeleng potongan kode

Bandhingake HTML ing Swift

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

Kadhangkala sampeyan kudu mesthekake yen dokumen ing HTML format durung diganti, lan yen wis, sampeyan kudu ngerteni apa bedane. Cukup gunakake alat diff Swift kanggo mbandhingake rong HTML 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 HTML dokumen, lan sampeyan bisa kanthi cepet nemokake owah-owahan cilik lan ngekspor bedane kasebut menyang dokumen kanthi format sing trep.

Coba mbandhingake HTML dokumen

Priksa kepiye solusi kanggo mbandhingake HTML file nggunakake Swift SDK. Kanggo entuk iki, muat HTML 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 AsposeWordsCloud

let config =
    Configuration(clientId: "####-####-####-####-####", clientSecret: "##################");
let api = try WordsAPI(configuration: config);
let fileName1 = "Input1.html";
let fileName2 = "Input2.html";
let fileResult = "Output.html";

//  Upload dokumen menyang panyimpenan maya.
let firstDocumentContent = InputStream(url: URL(string: fileName1))!;
let uploadFirstFileRequest =
    UploadFileRequest(fileContent: firstDocumentContent, path: fileName1);
_ = try api.uploadFile(request: uploadFirstFileRequest);

let secondDocumentContent = InputStream(url: URL(string: fileName2))!;
let uploadSecondFileRequest =
    UploadFileRequest(fileContent: secondDocumentContent, path: fileName2);
_ = try api.uploadFile(request: uploadSecondFileRequest);

//  Mbandhingake dokumen ing awan.
let compareDataOptions = CompareData()
  .setAuthor(author: "author")
  .setFileReference(fileReference: FileReference(remoteFilePath: fileName2));
let compareDocumentRequest =
    CompareDocumentRequest(name: fileName1, compareData: compareDataOptions,
	destFileName: fileResult);
_ = try api.compareDocument(request: compareDocumentRequest);

//  Download dokumen asil saka panyimpenan maya.
let downloadFileRequest = DownloadFileRequest(path: fileResult);
let downloadFileResult = try api.downloadFile(request: downloadFileRequest);
try downloadFileResult?.first?.value.write(
    to: currentDir!.appendingPathComponent(fileResult, isDirectory: false));
Kode roto
  
Nyalin kode Swift menyang clipboard

Cara mbandhingake rong file teks

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

Swift perpustakaan kanggo nggunakake mbandhingake

Sampeyan bisa nggunakake manajer paket Swift lan manajer dependensi Cocoapods kanggo nginstal Aspose.Words Cloud SDK for Swift. Informasi rinci babagan nginstal paket diwenehi ing bagean "Installation and Usage".

Minangka alternatif, sampeyan bisa clone Aspose.Words Cloud SDK for Swift saka GitHub lan nggunakake ing project.

Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.

Requirements Sistem

Swift 4.2 utawa luwih anyar

Deleng Repository Documentation kanggo ndeleng rincian liyane.

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.