001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.documentlibrary.util;
016    
017    import com.liferay.portal.kernel.image.ImageTool;
018    import com.liferay.portal.kernel.repository.model.FileVersion;
019    
020    import java.io.InputStream;
021    
022    /**
023     * @author Sergio González
024     */
025    public interface PDFProcessor {
026    
027            public static final String PREVIEW_TYPE = ImageTool.TYPE_PNG;
028    
029            public static final String THUMBNAIL_TYPE = ImageTool.TYPE_PNG;
030    
031            public void generateImages(FileVersion fileVersion)
032                    throws Exception;
033    
034            public String getGlobalSearchPath() throws Exception;
035    
036            public InputStream getPreviewAsStream(FileVersion fileVersion, int index)
037                    throws Exception;
038    
039            public int getPreviewFileCount(FileVersion fileVersion);
040    
041            public long getPreviewFileSize(FileVersion fileVersion, int index)
042                    throws Exception;
043    
044            public InputStream getThumbnailAsStream(
045                            FileVersion fileVersion, int thumbnailIndex)
046                    throws Exception;
047    
048            public long getThumbnailFileSize(
049                            FileVersion fileVersion, int thumbnailIndex)
050                    throws Exception;
051    
052            public boolean hasImages(FileVersion fileVersion);
053    
054            public boolean isDocumentSupported(FileVersion fileVersion);
055    
056            public boolean isDocumentSupported(String mimeType);
057    
058            public boolean isImageMagickEnabled() throws Exception;
059    
060            public boolean isSupported(String mimeType);
061    
062            public void reset() throws Exception;
063    
064            public void trigger(FileVersion fileVersion);
065    
066    }