Class CommandLineConvertor
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.plugins.flipbook.commandline.CommandLineConvertor
-
- All Implemented Interfaces:
Document2ImagesConvertorPolicy
,LogEnabled
public class CommandLineConvertor extends AbstractLogEnabled implements Document2ImagesConvertorPolicy
Configurable command-line PDF to PNG convertor.
-
-
Constructor Summary
Constructors Constructor Description CommandLineConvertor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convert(File pdfFile, File folder)
Convert the given document file to PNG images, one image per page.protected String[]
getCommandLine(String filePath)
Get the command line to generate PNG images from the PDF file.List<String>
getSupportedMimeTypes()
Get the list of mime types the convertor can convert-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Constructor Detail
-
CommandLineConvertor
public CommandLineConvertor()
-
-
Method Detail
-
convert
public void convert(File pdfFile, File folder) throws IOException, FlipbookException
Description copied from interface:Document2ImagesConvertorPolicy
Convert the given document file to PNG images, one image per page.- Specified by:
convert
in interfaceDocument2ImagesConvertorPolicy
- Parameters:
pdfFile
- the document file to convert.folder
- the destination folder.- Throws:
IOException
- if an I/O error occurs.FlipbookException
- if a document error occurs.
-
getCommandLine
protected String[] getCommandLine(String filePath)
Get the command line to generate PNG images from the PDF file.- Parameters:
filePath
- the PDF file path.- Returns:
- the command line as an array containing the command to call and its arguments.
-
getSupportedMimeTypes
public List<String> getSupportedMimeTypes()
Description copied from interface:Document2ImagesConvertorPolicy
Get the list of mime types the convertor can convert- Specified by:
getSupportedMimeTypes
in interfaceDocument2ImagesConvertorPolicy
- Returns:
- The list of supported mime-types
-
-