Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

PDF to PNG Transformation Configuration

jharkins2 edited this page Aug 12, 2020 · 1 revision

OpenContent has three PDF->PNG transformation service implementations: MuPDF, Ghostscript, and PDFium. Any of the transformation services may be used to transform a PDF document into a PNG image file. This will assume you have already setup the given transformation executable on your target system through the install guide, and just need to configure OpenContent to use the correct service.

Enabling the Target Transformation Service

Locate the project-bean-config.xml file in your build. For Alfresco AMP builds this should be located in config\alfresco\module\com.tsgrp.opencontent\config, for all other builds in WEB-INF\classes. Your file should have this section:

<!-- PDF->PNG TRANSFORMATION CONFIGURATION -->
<!-- Only one of these should be uncommented, whichever transformer (MuPDF, Ghostscript, or PDFium) you want to use for PDF->PNG transformations -->
<import resource="classpath:@configBase@transformation-mupdf-bean-config.xml" />
<!--<import resource="classpath:@configBase@transformation-ghostscript-bean-config.xml" />-->
<!--<import resource="classpath:@configBase@transformation-pdfium-bean-config.xml" />-->

You just need to uncomment the config XML related to the transformation service you wish to enable. Only one of these should be uncommented. The above example enables MuPDF as the transformation service to use.

If you only see a single config XML file import, your build most likely was only built for a single transformation service. You can confirm this by looking in the lib (Alfresco) or WEB-INF\lib (non-Alfresco) directory of your build. If you only have a single one of the *transformMuPdf*.jar, *transformGhostscript*.jar, and *transformPdfium*.jar files, your build will only work for that single service. A new build is required to use a different service.

Setting the Transformation Executable Path

In any of OpenContent's property files (described here) the path to the target transformation executable path must be set:

#PDF->Transformation Paths
#Only one needs to be set, the Transformer chosen in project-bean-config.xml
mu.path=
ghostscript.path=
pdfium.path=

Only the path for the service you have configured is required, however more than one of these properties can be set without issue.

Clone this wiki locally