SproutCMS

This is the code documentation for the SproutCMS project

class FileConvert

Converter between various file types

For all features to work, the following programs need to be installed:
- convert (e.g. from the graphicsmagick-imagemagick-compat Debian package)
- exiftool (e.g. from the libimage-exiftool-perl Debian package)
- libreoffice (e.g. from the libreoffice-common Debian package)

Extending this class

<?php
/**
* New class description goes here
* 
* @author Your Name, 2026-09-16
**/
class NewClassName extends FileConvert {
    
    /**
    * Use 'exiftool' to determine the number of pages in a file
    **/
    public function getPageCount (string $filename) {
        // Method code goes here
    }
    
    /**
    * Checks to see that a conversion program is installed
    **/
    public function installed (string $program) {
        // Method code goes here
    }
    
    /**
    * Validates that an output file extension is of a valid format
    **/
    private function validateExtension (string $ext) {
        // Method code goes here
    }
    
    /**
    * Convert file using LibreOffice
    **/
    public function libreoffice (string $in_file, string $out_ext) {
        // Method code goes here
    }
    
    /**
    * Convert file using ImageMagick
    **/
    public function imagemagick (string $in_file, string $out_ext, int $page_index, int $density) {
        // Method code goes here
    }
    
}
?>