Owahi Word file utawa PDF ing Dart/Flutter SDK

Gunakake REST API kanggo ngowahi file ing Dart kanthi program

Nalika pangembang ngowahi dokumen nganggo solusi Dart/Flutter sing diwenehake, sing bener-bener diowahi yaiku Model Obyek Dokumen (DOM). Mangkono, meh kabeh owah-owahan bisa digawe kanggo document dituduhake minangka DOM. Kanthi Dart/Flutter 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.

Ndeleng potongan kode

Sunting dokumen ing Dart nggunakake REST API

Pustaka Dart/Flutter 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 Dart 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.

Sunting teks ing Dart

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 Dart ing dokumen kasebut.

Sunting tabel ing Dart

Pilihan panyuntingan dokumen populer liyane yaiku nyunting tabel. Dart/Flutter SDK kita ngidini sampeyan nggarap tabel lan teks ing sel tabel.

Pangembang Dart bisa nambah utawa mbusak sel tabel lan tabel, uga nambah, ngowahi lan mbusak teks ing njero.

Tambah gambar menyang dokumen nggunakake Dart

Saliyane nyunting teks lan tabel, ana pilihan umum liyane: nambahake gambar menyang dokumen ing Dart. Pangembang Dart/Flutter uga bisa nambah gambar menyang file nggunakake DOM.

Ngedit dokumen online

Coba Dart/Flutter 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:

Unggah dokumen sing pengin diowahi
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(
   'Input.docx').readAsBytes()).buffer.asByteData();
final requestParagraph = ParagraphInsert();
requestParagraph.text = 'Morbi enim nunc faucibus a.';

final insertParagraphRequest = InsertParagraphOnlineRequest(requestDocument, requestParagraph);
final insertParagraph = await wordsApi.insertParagraphOnline(insertParagraphRequest);

final convertRequest = ConvertDocumentRequest(insertParagraph.document.values.first, 'docx');
final convert = 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 requestTable = TableInsert();
requestTable.columnsCount = 1;
requestTable.rowsCount = 2;

final insertTableRequest = InsertTableOnlineRequest(requestDocument, 
   requestTable, nodePath: '');
final insertTable = await wordsApi.insertTableOnline(insertTableRequest);

final convertRequest = ConvertDocumentRequest(insertTable.document.values.first, 'docx');
final convert = await wordsApi.convertDocument(convertRequest);
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 requestDrawingObject = DrawingObjectInsert();
requestDrawingObject.height = 0;
requestDrawingObject.left = 0;
requestDrawingObject.top = 0;
requestDrawingObject.width = 0;
requestDrawingObject.relativeHorizontalPosition = 
   DrawingObjectInsert_RelativeHorizontalPositionEnum.margin;
requestDrawingObject.relativeVerticalPosition = 
   DrawingObjectInsert_RelativeVerticalPositionEnum.margin;
requestDrawingObject.wrapType = DrawingObjectInsert_WrapTypeEnum.inline;

final requestImageFile = (await File(
   'Input2.docx').readAsBytes()).buffer.asByteData();
final insertDrawingObjectRequest = InsertDrawingObjectOnlineRequest(requestDocument, 
   requestDrawingObject, requestImageFile, nodePath: 'sections/0');
final insertDrawingObject = 
   await wordsApi.insertDrawingObjectOnline(insertDrawingObjectOnline);

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

Carane ngowahi file ing Dart

  1. Pasang 'Aspose.Words Cloud kanggo Dart/Flutter'
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek Dart sampeyan
  3. Muat dokumen sing arep diowahi ing Dart
  4. Lebokake isi ing wiwitan dokumen
  5. Download dokumen asil saka panyimpenan maya

Dart perpustakaan kanggo nggunakake panyuntingan dokumen

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.

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.