Work with Word Documents in Dart/Flutter

  Dart DOCX

Work with Word Documents in Dart/Flutter

Powerful Dart library for creating, editing and processing Word DOCX, DOC, RTF files. Open, generate, edit, split, merge, compare and convert Word documents using Dart SDK, fully compatible with Flutter. Easily convert PDF to Word (DOC, DOCX, ODT, RTF and HTML) and in the opposite direction with Aspose Cloud Dart library.

Table of Contents

The rapidly expanding use of mobile and web technologies has a deep impact on the software industry and provides a new dimension to application development.

Dart is a general-purpose programming language and a platform from Google for creating scalable cross-platform mobile and web applications. Dart is designed to deal with today's complexity of web technologies and provide support for the latest mobile development trends. It is great for creating iOS and Android apps, but not limited to them and could effectively be used to build desktop and server-side software as well.

Dart has been developed over the last years and started getting broad attention when Google has introduced Flutter — a portable, robust UI framework for native mobile app development on both Android and iOS operating systems. Flutter provides the developer with tools to create stable, fast, professional-looking mobile software.

About Dart language

With the support for classes, single inheritance, properties, lambda expressions, generics, enums, Dart is a relatively easy-to-learn language for programmers with C# and Java background.

Dart's major strengths are: code portability, stability, speed and asynchronicity. Dart code runs in a Dart-compatible environment, known as Dart Virtual Machine or DartVM. Also, it can be transpired to JavaScript or compiled to native x86 and ARM code. Software written in Dart results in native performance for both iOS and Android platforms.

One of the most powerful, interesting and nontrivial features of the language is built-in support for asynchronous operations. Asynchronicity lies at the heart of Dart's programming model.

Even though Dart/DartVM are pretty new and still evolving, they are very stable and ready for commercial use. Dart developers are kindly supplied with a code editor, a powerful debugger and a big package ecosystem just out of the box.

What is Aspose Words Cloud API

Aspose Words Cloud API is a modern REST API designed to control Word documents programmatically. It is not limited to processing of Microsoft Word documents only, but also supports a wide range of OpenOffice file formats, PDF and includes a set of advanced features to convert, merge, split documents.

Aiming for greater flexibility, our team provides various options at the choice of the developer: to interact with REST API directly or to use high-level SDKs from the Words Cloud SDK family, like the Dart SDK. All our Cloud SDKs strive to protect developers from the underlying low-level details and provide easy access to powerful document-processing functionality.

What is Aspose Words Cloud Dart SDK

Aspose Words provides all features and tools needed by Dart developers to make awesome modern mobile and web document-processing software with no drawbacks in scalability and performance. Our team tests each SDK release thoroughly before deployment, therefore developers can be assured that Dart SDK is reliable, fault-free and ready for production use.

Functional Capabilities

You can easily automate your everyday documentation workflow tasks and increase overall business productivity by creating scalable, fast and platform-independent applications with a rich set of features. Cloud Dart SDK provides functions to read, edit, merge, split and convert documents. You can work with a complete set of document components, such as main text, sections, headers/footers, tables, drawing objects, fonts, hyperlinks, comments, watermarks, math objects and others.

Please feel free to test the Cloud API functionality directly from your web browser with our online converter, viewer, editor, splitter, merger and other apps.

Security

Before leveraging Cloud API you need to register within Words Cloud Services and obtain Client Id & Secret credentials. The Client Id & Secret pair is used to authenticate API requests and provide a secure way to transmit your data.


  • Main
  • Convert
  • Structure
  • Content
  • Tables
  • MailMerge
  • Other
  • Plugins
  •  

Requirements

Dart 2.6.0 or higher

Supported Document Formats

You can both read and write documents in: DOCX, DOC, PDF, MD, RTF, DOCM, DOTX, DOT, DOTM, ODT, OTT, XML, HTML, MHTML, XHTML, TXT.
The write-only formats are: XPS, OpenXPS, PS, JPEG, PNG, BMP, SVG, TIFF, EMF, PCL, EPUB.
The read-only formats are: MOBI, CHM.
For more details, please check Supported File Formats.

Dart Cloud SDK Installation

The following are step-by-step instructions on how to install the Dart SDK:

  1. Download and install the Dart environment.
  2. Import the Dart SDK into your project by adding aspose_words_cloud dependency in pubspec.yaml:
    dependencies:
    aspose_words_cloud: 20.11.0

Getting Started with Cross-Platform Mobile Development in Dart

Dart Cloud SDK provides a rich set of code examples to illustrate the use of API. And please, have a look at the Developer Guide for other good practices and ideas.

The following code sample in Dart demonstrates how to use some basic API calls.

Convert PDF to Word in Dart

The following code sample shows how to convert PDF to DOCX in the Cloud and save the result to a local file:

Convert PDF to DOCX
import 'package:aspose_words_cloud/aspose_words_cloud.dart';
import 'dart:typed_data';
import 'dart:io';

final clientId = '####-####-####-####-####';
final secret = '##################';
var configuration = Configuration(secret, clientId);
var wordsApi = WordsApi(configuration);

var bytes = File('sample.pdf').readAsBytesSync();
var request = ConvertDocumentRequest(ByteData.view(bytes.buffer), 'docx');
wordsApi.convertDocument(request);

Advanced Features

How to open and edit a DOCX document in Dart

  1. Add the latest version of Dart library.
  2. Go to the Aspose Cloud Dashboard.
  3. Create a new Account to access all applications and services or Sign In to your existing account.
  4. Click on Applications in the left menu to get Client Id and Client Secret.
  5. Upload a DOCX file to the Cloud Storage or use directly in the request body.
  6. Check Developer Guide to edit a DOCX file in Dart.

Support and Learning Resources