Tambah tandha banyu menyang PDF file utawa Word utawa mbusak tandha banyu sing wis ditambahake sadurunge nggunakake Swift

Kanthi perpustakaan Swift iki, pangembang bisa nambahake gambar utawa watermark teks ing PDF dokumen utawa Word, uga mbusak tandha banyu sing wis ditambahake sajrone sawetara detik.

Nglindhungi dokumen saka distribusi ora sah lan nambah watermark online. Kanggo nindakake iki, mung mbukak PDF, Word utawa format dokumen liyane lan tambahake teks utawa watermark gambar nggunakake Swift. Banjur simpen PDF dokumen utawa Word sing ditandhani banyu ing format sing trep kayata DOC, DOCX, PDF, HTML, RTF, XPS lan liya-liyane. Sampeyan uga bisa mbusak tandha banyu saka dokumen supaya luwih gampang diproses kajaba nglanggar hak sapa wae.

Ndeleng potongan kode

Tambah watermark ing Swift

Kanthi API Swift iki, pangembang bisa nambah tandha banyu menyang PDF, Word, utawa dokumen liyane kanthi online. Sampeyan bisa nggawe tandha banyu nggunakake teks utawa gambar banjur lebokake tandha banyu kasebut menyang PDF dokumen utawa Word kanthi nyetel sudut overlay ing Swift.

Cathetan: ora perlu nginstal aplikasi utawa perpustakaan pihak katelu. Mulane, solusi piranti lunak Swift kita gampang banget digunakake.

Mbusak tandha banyu ing Swift

SDK Swift sing diwenehake uga mbantu mbusak tandha banyu. Contone, mbusak watermark ing Word tegese sampeyan bisa mbukak Word dokumen sing dipengini kanthi prangko teks utawa watermark gambar, mbusak tandha banyu iki saka dokumen nggunakake Swift, banjur nyimpen file output ing format sing trep.

Watermark ing Word utawa PDF

Kanggo ngevaluasi API Swift kita, muat dokumen sing pengin ditambahake watermark lan watermark minangka gambar utawa teks. Banjur pilih format file ekspor sing trep - DOCX, PDF, MD, HTML, TXT, DOC, RTF, EPUB, XPS lan liya-liyane.

Gunakake conto ing ngisor iki kanggo ndeleng cara kerjane:

File kudu nambah watermarks
Kode roto
Unggah gambar sing pengin dilebokake
Pilih format target saka dhaptar
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);
Kode roto
  
Nyalin kode Swift menyang clipboard

Carane mbusak watermark ing Swift

  1. Pasang Aspose.Words Cloud for Swift
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek Swift sampeyan
  3. Konfigurasi API nggunakake tombol app
  4. Muat dokumen sing pengin dibusak saka watermark
  5. Nggawe panjalukan kanggo mbusak watermark
  6. Simpen asil menyang format file sing trep

Swift perpustakaan kanggo nggunakake watermarks

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 dokumen paling populer kanggo nambah watermark

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.