aspose_words_cloud 20.11.0 aspose_words_cloud: ^20.11.0 copied to clipboard
This package allows you to work with Aspose.Words Cloud REST APIs in your Dart applications quickly and easily, with zero initial cost.
// Import dependencies
import 'package:aspose_words_cloud/aspose_words_cloud.dart';
import 'dart:convert';
import 'dart:io';
// Configure words api client
var configuration = Configuration('ClientId', 'ClientSecret');
var wordsApi = WordsApi(configuration);
// Upload file to cloud
var localFileContent = await (File('./test_data/Common/test_doc.docx').readAsBytes());
var uploadRequest = UploadFileRequest(ByteData.view(localFileContent.buffer), 'fileStoredInCloud.docx');
await wordsApi.uploadFile(uploadRequest);
// Save file as pdf in cloud
var saveOptionsData = SaveOptionsData()
..saveFormat = 'pdf'
..fileName = 'destStoredInCloud.pdf';
var saveAsRequest = SaveAsRequest('fileStoredInCloud.docx', saveOptionsData);
await wordsApi.saveAs(saveAsRequest);