Nambahake tandha banyu menyang DOCX utawa mbusak tandha banyu sing sadurunge ditambahake nggunakake Dart

Nganggo perpustakaan Dart/Flutter iki, cap DOCX dokumen nganggo gambar utawa teks banyu utawa mbusak tandha banyu sing wis ditambahake ing sawetara langkah.

Tambah teks utawa gambar watermark menyang DOCX dokumen nggunakake Dart. 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.

Ndeleng potongan kode

DOCX - nambah watermark ing Dart

Kanthi API Dart/Flutter iki, pangembang bisa nambah tandha banyu menyang DOCX online. Mung nggawe watermark nggunakake teks utawa gambar banjur lebokake watermark menyang DOCX dokumen ing Dart.

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

Mbusak tandha banyu saka DOCX - Dart

SDK Dart/Flutter 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 Dart, banjur simpen file output ing format sing trep - DOC, DOCX, PDF, JPEG, PNG, TIFF lan liya-liyane.

Nggarap watermark ing DOCX

Kanggo ngevaluasi carane nambah utawa mbusak tandha banyu ing DOCX nganggo API Dart/Flutter, 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:

File kudu nambah watermarks
Kode roto
Unggah gambar sing pengin dilebokake
Pilih format target saka dhaptar
import 'package:aspose_words_cloud/aspose_words_cloud.dart';

final config = Configuration("####-####-####-####-####", "##################");
final wordsApi = WordsApi(config);

final requestDocument = (await File('Input1.docx').readAsBytes()).buffer.asByteData();
final requestImageStream = (await File('Input2.jpg').readAsBytes()).buffer.asByteData();
final requestWatermarkData = WatermarkDataImage();
requestWatermarkData.image = FileReference.fromLocalFile(requestImageStream);
final insertWatermarkRequest = InsertWatermarkOnlineRequest(
    requestDocument, requestWatermarkData);
final insertWatermarkResult = await wordsApi.InsertWatermarkOnline(
    insertWatermarkRequest);

final convertRequest = ConvertDocumentRequest(
    insertWatermarkResult.document.values.first, 'docx');
await wordsApi.convertDocument(convertRequest);
import 'package:aspose_words_cloud/aspose_words_cloud.dart';

final config = Configuration("####-####-####-####-####", "##################");
final wordsApi = WordsApi(config);

final requestDocument = (await File('Input.docx').readAsBytes()).buffer.asByteData();
final requestWatermarkData = WatermarkDataText();
requestWatermarkData.text = 'This is the watermark text';
requestWatermarkData.layout = WatermarkDataText_LayoutEnum.diagonal;
final insertWatermarkRequest = InsertWatermarkOnlineRequest(
    requestDocument, requestWatermarkData);
final insertWatermarkResult =
    await wordsApi.InsertWatermarkOnline(insertWatermarkRequest);

final convertRequest = ConvertDocumentRequest(
    insertWatermarkResult.document.values.first, 'docx');
await wordsApi.convertDocument(convertRequest);
import 'package:aspose_words_cloud/aspose_words_cloud.dart';

final config = Configuration("####-####-####-####-####", "##################");
final wordsApi = WordsApi(config);

final requestDocument = (await File('Input.docx').readAsBytes()).buffer.asByteData();
final deleteWatermarkOnline = DeleteWatermarkOnlineRequest(requestDocument);
final deletedWatermark = await wordsApi.deleteWatermarkOnline(deleteWatermarkOnline);

final convertDocument = ConvertDocumentRequest(deletedWatermark.document.values.first, 'docx');
await wordsApi.convertDocument(convertDocument);
Kode roto
  
Nyalin kode Dart menyang clipboard

Carane mbusak watermark ing DOCX nggunakake Dart

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

Pustaka Dart kanggo nggunakake tandha banyu ing DOCX

Klone Aspose.Words Cloud SDK for Dart saka GitHub lan gunakake ing proyek sampeyan. Tambah dependensi iki menyang pubspec.yaml: dependencies: aspose_words_cloud: 22.4.0

Tututi Instructions iki supaya cepet entuk kredensial keamanan sing dibutuhake lan ngakses REST API kita.

Requirements Sistem

Deleng Repository Documentation kanggo ndeleng rincian.

Format file liyane sing didhukung

Sampeyan bisa nambah watermark menyang dokumen ing format liyane:

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.