Nalika pangembang ngowahi dokumen nganggo solusi Swift sing diwenehake, sing bener-bener diowahi yaiku Model Obyek Dokumen (DOM). Mangkono, meh kabeh owah-owahan bisa digawe kanggo document dituduhake minangka DOM. Kanthi Swift SDK sing disedhiyakake, pangembang bisa kanthi gampang nyunting dokumen: ngowahi teks, nganyari tabel, nambah gambar lan liya-liyane. Cukup muat Word, PDF utawa file ing format muat sing didhukung, gawe owah-owahan sing dibutuhake kanthi program lan ekspor asil menyang format nyimpen sing didhukung.
Pustaka Swift kita menehi pangembang kemampuan kanggo ngowahi dokumen kanthi langsung kanthi nyunting Document Object Model (DOM), tegese ora ana piranti lunak tambahan sing kudu diinstal.
Penting kanggo ngerti yen nggunakake solusi Swift iki, sampeyan bisa ngowahi dokumen ing format apa wae sing didhukung. Contone, sampeyan bisa mbukak file ing PDF, DOCX, DOC, RTF, ODT, EPUB, HTML lan format liyane, banjur ngowahi file iki lan disimpen ing format sing padha utawa ing format sing didhukung liyane.
Kasus sing paling populer kanggo nyunting Word, PDF utawa dokumen liyane yaiku nyunting teks. Kanthi solusi piranti lunak sing diwenehake, sampeyan bisa nambah, ngowahi utawa mbusak teks nggunakake Swift ing dokumen kasebut.
Pilihan panyuntingan dokumen populer liyane yaiku nyunting tabel. Swift SDK kita ngidini sampeyan nggarap tabel lan teks ing sel tabel.
Pangembang Swift bisa nambah utawa mbusak sel tabel lan tabel, uga nambah, ngowahi lan mbusak teks ing njero.
Saliyane nyunting teks lan tabel, ana pilihan umum liyane: nambahake gambar menyang dokumen ing Swift. Pangembang Swift uga bisa nambah gambar menyang file nggunakake DOM.
Coba Swift SDK sing kuat iki lan evaluasi sawetara opsi ing panyuntingan dokumen. Nggunakake conto ing ngisor iki, muat dokumen sampeyan lan gawe sawetara owah-owahan: nambah teks, nambah tabel lan sel tabel kanthi teks utawa lebokake gambar menyang dokumen:
import AsposeWordsCloud
let config = Configuration(clientId: "####-####-####-####-####",
clientSecret: "##################");
let api = try WordsAPI(configuration: config);
let requestDocument = InputStream(url: URL(string: "Input.docx"))!;
let requestParagraph = ParagraphInsert()
.setText(text: "Morbi enim nunc faucibus a.");
let insertParagraphRequest = InsertParagraphOnlineRequest(document: requestDocument,
paragraph: requestParagraph);
let insertParagraph = try api.insertParagraphOnline(request: insertParagraphRequest);
let convertRequest = ConvertDocumentRequest(document: insertParagraph.document.values.first,
format: "docx");
let convert = 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 requestTable = TableInsert()
.setColumnsCount(columnsCount: 1)
.setRowsCount(rowsCount: 2);
let insertTableRequest = InsertTableOnlineRequest(document: requestDocument,
table: requestTable, nodePath: "");
let insertTable = try api.insertTableOnline(request: insertTableRequest);
let convertRequest = ConvertDocumentRequest(document: insertTable.document.values.first,
format: "docx");
let convert = try api.convertDocument(request: convertRequest);
import AsposeWordsCloud
let config = Configuration(clientId: "####-####-####-####-####",
clientSecret: "##################");
let api = try WordsAPI(configuration: config);
let requestDocument = InputStream(url: URL(string: "Input1.docx"))!;
let requestDrawingObject = DrawingObjectInsert()
.setHeight(height: 0)
.setLeft(_left: 0)
.setRelativeHorizontalPosition(
relativeHorizontalPosition: DrawingObjectInsert.RelativeHorizontalPosition.margin)
.setRelativeVerticalPosition(
relativeVerticalPosition: DrawingObjectInsert.RelativeVerticalPosition.margin)
.setTop(top: 0)
.setWidth(width: 0)
.setWrapType(wrapType: DrawingObjectInsert.WrapType.inline);
let requestImageFile = InputStream(url: URL(string: "Input2.docx"))!;
let insertDrawingObjectRequest = InsertDrawingObjectOnlineRequest(document: requestDocument,
drawingObject: requestDrawingObject, imageFile: requestImageFile, nodePath: "sections/0");
let insertDrawingObject =
try api.insertDrawingObjectOnline(request: insertDrawingObjectRequest);
let convertRequest = ConvertDocumentRequest(
document: insertDrawingObject.document.values.first, format: "docx");
let convert = try api.convertDocument(request: convertRequest);
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.