aspose_words_cloud 20.10.1 aspose_words_cloud: ^20.10.1 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 = new Configuration('AppKey', 'AppSid');
var wordsApi = new WordsApi(configuration);
// Upload file to cloud
var localFileContent = await (new File('./test_data/Common/test_doc.docx').readAsBytes());
var uploadRequest = new UploadFileRequest(ByteData.view(localFileContent.buffer), 'fileStoredInCloud.docx');
await wordsApi.uploadFile(uploadRequest);
// Save file as pdf in cloud
var saveOptionsData = new SaveOptionsData()
..saveFormat = "pdf"
..fileName = "destStoredInCloud.pdf";
var saveAsRequest = new SaveAsRequest("fileStoredInCloud.docx", saveOptionsData);
await wordsApi.saveAs(saveAsRequest);