mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2E to HEAD
17385: Minor performance tweaks and code cleanup/consolidation in SiteServiceImpl. 17386: ETHREEOH-3066 Added supporting logging 17387: Minor javadoc updates pertinent to the FreeMarker API chapter updates. 17392: Fix to unreported issue in User Profile where a recent fix incorrectly encoding javascript values as ?html. - values passed into JS components in FreeMarker template should use ?js_string operator - not the ?html operator. 17399: ETHREEOH-3269, ETHREEOH-3271 - Dropdown markup changed for keyboard access 17400: ETHREEOH-3278 - Navigator is very wide 17401: Concatenate DocLib JavaScript files git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@18120 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -41,18 +41,21 @@ import org.alfresco.service.cmr.repository.ContentReader;
|
||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||
import org.alfresco.service.cmr.repository.TransformationOptions;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.sun.pdfview.PDFFile;
|
||||
import com.sun.pdfview.PDFPage;
|
||||
|
||||
/**
|
||||
* Makes use of the {@link http://www.pdfbox.org/ PDFBox} library to
|
||||
* Makes use of the {@link https://pdf-renderer.dev.java.net/ PDFRenderer} library to
|
||||
* perform conversions from PDF files to images.
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class PdfToImageContentTransformer extends AbstractContentTransformer2
|
||||
{
|
||||
private static final Log logger = LogFactory.getLog(PdfToImageContentTransformer.class);
|
||||
/**
|
||||
* Currently the only transformation performed is that of text extraction from PDF documents.
|
||||
*/
|
||||
@@ -87,6 +90,18 @@ public class PdfToImageContentTransformer extends AbstractContentTransformer2
|
||||
ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
|
||||
|
||||
PDFFile pdffile = new PDFFile(buf);
|
||||
|
||||
// Log the PDF version of the file being transformed.
|
||||
if (logger.isInfoEnabled())
|
||||
{
|
||||
int pdfMajorVersion = pdffile.getMajorVersion();
|
||||
int pdfMinorVersion = pdffile.getMinorVersion();
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("File being transformed is of pdf version ")
|
||||
.append(pdfMajorVersion).append(".").append(pdfMinorVersion);
|
||||
logger.info(msg.toString());
|
||||
}
|
||||
|
||||
PDFPage page = pdffile.getPage(0);
|
||||
|
||||
//get the width and height for the doc at the default zoom
|
||||
|
Reference in New Issue
Block a user