Tambah teks utawa gambar watermark menyang DOCX dokumen nggunakake Swift. Muat DOCX dokumen lan lebokake tandha banyu sing dibutuhake. Banjur simpen asil ing format sing trep kayata DOCX, PDF, MD, HTML, TXT, DOC, RTF, EPUB, XPS lan liya-liyane, lan nuduhake dokumen sing diwenehi tandha banyu karo wong liya. Uga mbusak tandha banyu saka DOCX dokumen yen tandha banyu sadurunge ditambahake menyang dokumen, lan alasan kanggo nambah ora relevan maneh.
Kanthi API Swift iki, pangembang bisa nambah tandha banyu menyang DOCX online. Mung nggawe watermark nggunakake teks utawa gambar banjur lebokake watermark menyang DOCX dokumen ing Swift.
Cathetan: ora perlu nginstal aplikasi utawa perpustakaan pihak katelu. Mulane, solusi piranti lunak Swift kita gampang banget digunakake.
SDK Swift sing diwenehake uga mbiyantu mbusak tandha banyu saka DOCX. Mbusak tandha banyu ing DOCX tegese sampeyan bisa mbukak DOCX dokumen sing dipengini kanthi prangko teks utawa gambar, mbusak tandha banyu iki saka DOCX nggunakake Swift, banjur simpen file output ing format sing trep - DOC, DOCX, PDF, JPEG, PNG, TIFF lan liya-liyane.
Kanggo ngevaluasi carane nambah utawa mbusak tandha banyu ing DOCX nganggo API Swift, muat DOCX lan tandha banyu minangka gambar utawa teks. Banjur pilih format file ekspor sing trep - DOC, DOCX, PDF, HTML, RTF, XPS lan liya-liyane.
Gunakake conto ing ngisor iki kanggo ndeleng cara kerjane:
import AsposeWordsCloud
let config = Configuration(
clientId: "####-####-####-####-####", clientSecret: "##################");
let api = try WordsAPI(configuration: config);
let requestDocument = InputStream(url: URL(string: "Input1.docx"))!;
let requestImageStream = InputStream(url: URL(string: "Input2.jpg"))!;
let requestWatermarkData = WatermarkDataImage()
.setImage(image: FileReference(localFileContent: requestImageStream));
let insertWatermarkRequest = InsertWatermarkOnlineRequest(
document: requestDocument, watermarkData: requestWatermarkData);
let insertWatermarkResult = try api.insertWatermarkOnline(
request: insertWatermarkRequest);
let convertRequest = ConvertDocumentRequest(
document: insertWatermarkResult.document.values.first, format: "docx");
_ = try api.convertDocument(request: convertRequest);
import AsposeWordsCloud
let config = Configuration(
clientId: "####-####-####-####-####", clientSecret: "##################");
let api = try WordsAPI(configuration: config);
let requestDocument = InputStream(url: URL(string: "Input.docx"))!;
let requestWatermarkData = WatermarkDataText()
.setLayout(layout: WatermarkDataText.Layout.diagonal)
.setText(text: "This is the watermark text");
let insertWatermarkRequest = InsertWatermarkOnlineRequest(
document: requestDocument, watermarkData: requestWatermarkData);
let insertWatermarkResult = try api.insertWatermarkOnline(
request: insertWatermarkRequest);
let convertRequest = ConvertDocumentRequest(
document: insertWatermarkResult.document.values.first, format: "docx");
_ = try api.convertDocument(request: convertRequest);
import AsposeWordsCloud
let config = Configuration(
clientId: "####-####-####-####-####", clientSecret: "##################");
let api = try WordsAPI(configuration: config);
let requestDocument = InputStream(url: URL(string: "Input.docx"))!;
let deleteWatermarkOnline = DeleteWatermarkOnlineRequest(document: requestDocument);
let deletedWatermark = try api.deleteWatermarkOnline(request: deleteWatermarkOnline);
let convertDocument = ConvertDocumentRequest(
document: deletedWatermark.document.values.first, format: "docx");
_ = try api.convertDocument(request: convertDocument);
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.
Swift 4.2 utawa luwih anyar
Deleng Repository Documentation kanggo ndeleng rincian liyane.
Sampeyan bisa nambah watermark menyang dokumen ing format liyane: