public class MuPdfTransformer
extends java.lang.Object
Constructor and Description |
---|
MuPdfTransformer() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getNameForTempFile(java.lang.String outputFile)
Returns the png's new filename altered by MuPDF transformation (just adds a 1.png)
|
static void |
runMuPdfCommand(int firstPage,
int lastPage,
int resolution,
int outputWidth,
int outputHeight,
java.io.File inputFile,
java.io.File outFile,
boolean forThumbnails,
java.io.OutputStream output,
java.lang.String targetMimetype,
MuTransformationRequestContext muCtx)
Runs a MuPDF command to convert the specified page, saving a new png file.
|
public static void runMuPdfCommand(int firstPage, int lastPage, int resolution, int outputWidth, int outputHeight, java.io.File inputFile, java.io.File outFile, boolean forThumbnails, java.io.OutputStream output, java.lang.String targetMimetype, MuTransformationRequestContext muCtx)
firstPage
- The first page to convert.lastPage
- The last page to convert.resolution
- The desired resolution of the output png file.outputWidth
- The desired width in pixels of the output image. Optional.outputHeight
- The desired height in pixels of the output image. Optional.inputFile
- The path/name of the file to be converted.outFile.getAbsolutePath()
- The path/name that should be used as a TEMP location of outputted png. This file WILL be deleted upon method completion,
so don't depend on the file being there when the method completes (see 'output' as that is where the result is written to)forThumbnails
- Whether or not to render thumbnails for the document.output
- The stream we use to write to the output image to.targetMimetype
- The mimetype that the image will be transformed to.public static java.lang.String getNameForTempFile(java.lang.String outputFile)
outputFile
- The original output file path