RU | EN


Document Converter

Description

This project provides an example application for document conversion.

The application demonstrates how to work with LibreOffice.

The application allows to:

  • Convert documents to xlsx, ods or pdf formats.

The project uses cairo, hunspell, libepoxy, liblangtag and libreoffice library dependencies.

Build status:

  1. example - pipeline status
  2. dev - pipeline status

Table of contents

  1. Compatibility
  2. Build features
  3. Branches info
  4. Install and run
  5. Screenshots
  6. Use cases
  7. Known errors and restrictions
  8. Project structure
  9. Terms of use and participation in development

Compatibility

The project is compatible with all the current versions of the Aurora OS.

Build features

Clear building

  1. Make sure that you have 32 GB of RAM and SDK with docker (don't use VB for building this example).
  2. Open a terminal or command prompt.
  3. Navigate to the directory that contains your Git repository.
  4. Execute the command "git lfs pull" to download any files tracked by LFS.
  5. Execute the command "git submodule update --init --depth 1" to update and initialize submodules in the repository.
  6. Execute the command "mb2 -t AuroraOS-5.1.5.105-base-armv7hl build-init" to initialize the build environment.
  7. Execute the command "mb2 -t AuroraOS-5.1.5.105-base-armv7hl prepare" to apply the patches needed for the build.
  8. Execute the command "mb2 -t AuroraOS-5.1.5.105-base-armv7hl build" to start building the package.
  9. Execute the command to sign the rpm-package:
sfdk engine exec rpmsign-external sign  \
    --key absolute/path/to/key/file.pem \
    --cert absolute/path/to/cert/file.pem \
      absolute/path/to/rpm/package.rpm

The target rpm-package is in the RPMS directory of the project.

Solutions of possible problems

If building is failed with the next error

+ aclocal -I <path/to>/DocumentConverter/upstream/m4
autom4te: error: need GNU m4 1.4 or later: /usr/bin/m4
aclocal: error: echo failed with exit status: 1

then enter into the target and install the m4 dependency manually.

Repeated building for another target

The build is run in the same directory as the application sources so it's necessary to delete the previous building results before a new build for another target.

It's possible to use the script clear_build_results.sh <old target>. To use the script it's needed to connect to the build engine and to the previous build target. Next it's needed to invoke the script and specify the previous build target name:

./clear_build_results.sh AuroraOS-5.1.5.105-base-armv7hl

Or it's possible to do manually. Run the next commands from the project root directory:

  1. rm -fr libs_build
  2. rm -fr upstream/workdir
  3. rm -f application/Makefile
  4. cd libs/liblangtag && make distclean

Branches info

Branches

Install and run

The RPM package created in the Build features section needs to be uploaded to your device and installed like any other RPM package.

Screenshots

Screenshots

Use cases

Document conversion

  • To convert a document, press and hold the line with the required file to convert from the main application screen.
  • Select desired output format from the context menu.

Known errors and restrictions

LibreOffice in this implementation does not support simultaneous work in multiple threads. Attempting to initialize the Office object while another process is running may delay initialization until the current conversion is complete or cause the application to crash.

Project structure

The project has a standard structure of an application based on C++ and QML for Aurora OS.

  • application directory contains the application source code:
    • application.pro file describes the structure of the application for the qmake build system.
    • icons directory contains the application icons for different screen resolutions.
    • qml directory contains the QML source code and the UI resources.
      • cover directory contains the application cover implementations.
      • icons directory contains the additional custom UI icons.
      • pages directory contains the application pages.
      • DocumentConverter.qml file provides the application window implementation.
    • translations directory contains the UI translation files.
    • src directory contains the C++ source code.
      • main.cpp file is the application entry point.
    • ru.auroraos.DocumentConverter.desktop file defines the display and parameters for launching the application.
  • rpm directory contains the rpm-package build settings.
  • ru.auroraos.DocumentConverter.pro file describes the project that contains two subprojects where the first is responsible for building the libreoffice, and the second describes the structure of the application for the qmake build system.
  • upstream directory contains source code LibreOffice (git submodule).
  • tarballs directory of dependencies in the form of archives necessary for the build LibreOffice.
  • libs directory of dependencies in the form of source codes necessary for the build LibreOffice.

Terms of use and participation in development

The source code of the project is provided under the license, which allows its use in third-party applications.

Contributor License Agreement The contributor agreement documents the rights granted by contributors of the Open Mobile Platform.

Information about the contributors is specified in the AUTHORS file.

Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.