Nalika pangembang ngowahi dokumen nganggo solusi .NET sing diwenehake, sing bener-bener diowahi yaiku Model Obyek Dokumen (DOM). Mangkono, meh kabeh owah-owahan bisa digawe kanggo document dituduhake minangka DOM. Kanthi .NET 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 .NET 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 C# 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 C# ing dokumen kasebut.
Pilihan panyuntingan dokumen populer liyane yaiku nyunting tabel. .NET SDK kita ngidini sampeyan nggarap tabel lan teks ing sel tabel.
Pangembang C# 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 C#. Pangembang .NET uga bisa nambah gambar menyang file nggunakake DOM.
Coba .NET 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:
using Aspose.Words.Cloud.Sdk;
var config = new Configuration { ClientId = "####-####-####-####-####",
ClientSecret = "##################" };
var wordsApi = new WordsApi(config);
using var requestDocument = File.OpenRead("Input.docx");
var requestParagraph = new ParagraphInsert()
{
Text = "Morbi enim nunc faucibus a."
};
var insertParagraphRequest = new InsertParagraphOnlineRequest(requestDocument,
requestParagraph);
var insertParagraph = await wordsApi.InsertParagraphOnline(insertParagraphRequest);
var convertRequest = new ConvertDocumentRequest(insertParagraph.Document.Values.First(),
"docx");
var convert = await wordsApi.ConvertDocument(convertRequest);
using Aspose.Words.Cloud.Sdk;
var config = new Configuration { ClientId = "####-####-####-####-####",
ClientSecret = "##################" };
var wordsApi = new WordsApi(config);
using var requestDocument = File.OpenRead("Input.docx");
var requestTable = new TableInsert()
{
ColumnsCount = 1,
RowsCount = 2
};
var insertTableRequest = new InsertTableOnlineRequest(requestDocument,
requestTable, nodePath: "");
var insertTable = await wordsApi.InsertTableOnline(insertTableRequest);
var convertRequest = new ConvertDocumentRequest(insertTable.Document.Values.First(),
"docx");
var convert = await wordsApi.ConvertDocument(convertRequest);
using Aspose.Words.Cloud.Sdk;
var config = new Configuration { ClientId = "####-####-####-####-####",
ClientSecret = "##################" };
var wordsApi = new WordsApi(config);
using var requestDocument = File.OpenRead("Input1.docx");
var requestDrawingObject = new DrawingObjectInsert()
{
Height = 0f,
Left = 0f,
Top = 0f,
Width = 0f,
RelativeHorizontalPosition = DrawingObjectInsert.RelativeHorizontalPositionEnum.Margin,
RelativeVerticalPosition = DrawingObjectInsert.RelativeVerticalPositionEnum.Margin,
WrapType = DrawingObjectInsert.WrapTypeEnum.Inline
};
using var requestImageFile = File.OpenRead("Input2.docx");
var insertDrawingObjectRequest = new InsertDrawingObjectOnlineRequest(requestDocument,
requestDrawingObject, requestImageFile, nodePath: "sections/0");
var insertDrawingObject = await wordsApi.InsertDrawingObjectOnline(insertDrawingObjectRequest);
var convertRequest = new ConvertDocumentRequest(insertDrawingObject.Document.Values.First(),
"docx");
var convert = await wordsApi.ConvertDocument(convertRequest);
Instal 'Aspose.Words Cloud SDK for .NET' nggunakake manajer paket NuGet. Mung mbukak nuget install Aspose.Words-Cloud otomatis nginstal lan ngrujuk perakitan sing cocog ing proyek sampeyan. Minangka alternatif, sampeyan bisa kanthi manual tiron Aspose.Words Cloud SDK for .NET kode sumber saka GitHub lan nggunakake ing project. Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.
Deleng Repository Documentation kanggo ndeleng rincian liyane.