Skip to content

A Dart/Flutter library for converting documents using libreoffice.

License

Notifications You must be signed in to change notification settings

softyesti/libre_doc_converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibreDocConverter

A Dart/Flutter library for converting documents using libreoffice.

Features

Convert from .doc, .docx, .ppt, .pptx, .xls, .xlsx to .pdf.

Getting started

  • Windows, Linux or macOS.
  • LibreOffice application.

Usage

The examples are present in the /example folder.

Example: Document to pdf

import 'dart:io';
import 'package:libre_doc_converter/libre_doc_converter.dart';

Future<void> main() async {
  final converter = LibreDocConverter(
    inputFile: File('assets/example_document.docx'),
  );

  try {
    final pdfFile = await converter.toPdf();
    print(pdfFile.path);
  } catch (e) {
    rethrow;
  }
}

Example: Sheet to pdf

import 'dart:io';
import 'package:libre_doc_converter/libre_doc_converter.dart';

Future<void> main() async {
  final converter = LibreDocConverter(
    inputFile: File('assets/example_sheet.xlsx'),
  );

  try {
    final pdfFile = await converter.toPdf();
    print(pdfFile.path);
  } catch (e) {
    rethrow;
  }
}

About

A Dart/Flutter library for converting documents using libreoffice.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages