001/*
002 *  Copyright 2014 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.plugins.flipbook;
017
018import java.io.File;
019import java.io.IOException;
020import java.util.List;
021
022/**
023 * Converts a document file to PNG images, one image per page.
024 * The document images file name must begin with "page".
025 */
026public interface Document2ImagesConvertor
027{
028    
029    /** The avalon role. */
030    public static final String ROLE = Document2ImagesConvertor.class.getName();
031    
032    /**
033     * Get the list of mime types the convertor can convert
034     * @return The list of supported mime-types
035     */
036    public List<String> getSupportedMimeTypes();
037    
038    /**
039     * Convert the given document file to PNG images, one image per page.
040     * @param documentFile the document file to convert.
041     * @param folder the destination folder.
042     * @throws IOException if an I/O error occurs.
043     * @throws FlipbookException if a document error occurs.
044     */
045    public void convert(File documentFile, File folder) throws IOException, FlipbookException;
046    
047}