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 C#. 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.
Kanthi API .NET 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 C#.
Cathetan: ora perlu nginstal aplikasi utawa perpustakaan pihak katelu. Mulane, solusi piranti lunak .NET kita gampang banget digunakake.
SDK .NET 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 C#, banjur nyimpen file output ing format sing trep.
Kanggo ngevaluasi API .NET 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:
using Aspose.Words.Cloud.Sdk;
var config = new Configuration
{
ClientId = "####-####-####-####-####",
ClientSecret = "##################"
};
var wordsApi = new WordsApi(config);
using var requestDocument = File.OpenRead("Input1.docx");
using var requestImageStream = File.OpenRead("Input2.jpg");
var requestWatermarkData = new WatermarkDataImage()
{
Image = new FileReference(requestImageStream)
};
var insertWatermarkRequest = new InsertWatermarkOnlineRequest(
document: requestDocument,
watermarkData: requestWatermarkData
);
var insertWatermarkResult =
await this.WordsApi.InsertWatermarkOnline(insertWatermarkRequest);
var convertRequest = new ConvertDocumentRequest(
insertWatermarkResult.Document.Values.First(), "docx");
var convertResult = 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 requestWatermarkData = new WatermarkDataText()
{
Text = "This is the watermark text",
Layout = WatermarkDataText.LayoutEnum.Diagonal
};
var insertWatermarkRequest = new InsertWatermarkOnlineRequest(
document: requestDocument,
watermarkData: requestWatermarkData
);
var insertWatermarkResult =
await this.WordsApi.InsertWatermarkOnline(insertWatermarkRequest);
var convertRequest = new ConvertDocumentRequest(
insertWatermarkResult.Document.Values.First(), "docx");
var convertResult = 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 deleteWatermarkRequest = new DeleteWatermarkOnlineRequest(requestDocument);
var response = await WordsApi.DeleteWatermarkOnline(deleteWatermarkRequest);
var convertRequest = new ConvertDocumentRequest(response.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.