SproutCMS

This is the code documentation for the SproutCMS project

function libreoffice()

Convert file using LibreOffice

Usage

string FileConvert::libreoffice ( string $in_file , string $out_ext );

Arguments

  1. string $in_file
    Input filename, with full path
  2. string $out_ext
    Extension to convert file to, e.g. "pdf", "jpg", "txt".
           Note that spreadsheets cannot be directly converted to images, but can be converted to PDFs which can
           then be converted using FileConvert::imagemagick

Exceptions thrown

  • InvalidArgumentException
    The $out_ext argument has an invalid format
  • RuntimeException
    LibreOffice isn't installed/accessible to PHP
  • FileConversionException
    LibreOffice failed to convert the file

Return value

  • string
    Destination file in temp dir