Package net.sourceforge.tess4j.util
Class PdfGsUtilities
- java.lang.Object
-
- net.sourceforge.tess4j.util.PdfGsUtilities
-
public class PdfGsUtilities extends java.lang.Object
PDF utilities based on Ghostscript.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GS_INSTALL
-
Constructor Summary
Constructors Constructor Description PdfGsUtilities()
-
Method Summary
Modifier and Type Method Description static java.io.File[]
convertPdf2Png(java.io.File inputPdfFile)
Converts PDF to PNG format.static java.io.File
convertPdf2Tiff(java.io.File inputPdfFile)
Converts PDF to TIFF format.static int
getPdfPageCount(java.io.File inputPdfFile)
Gets PDF Page Count.static void
mergePdf(java.io.File[] inputPdfFiles, java.io.File outputPdfFile)
Merges PDF files.static void
splitPdf(java.io.File inputPdfFile, java.io.File outputPdfFile, int firstPage, int lastPage)
Splits PDF.
-
-
-
Field Detail
-
GS_INSTALL
public static final java.lang.String GS_INSTALL
- See Also:
- Constant Field Values
-
-
Method Detail
-
convertPdf2Tiff
public static java.io.File convertPdf2Tiff(java.io.File inputPdfFile) throws java.io.IOException
Converts PDF to TIFF format.- Parameters:
inputPdfFile
- input file- Returns:
- a multi-page TIFF image
- Throws:
java.io.IOException
-
convertPdf2Png
public static java.io.File[] convertPdf2Png(java.io.File inputPdfFile) throws java.io.IOException
Converts PDF to PNG format.- Parameters:
inputPdfFile
- input file- Returns:
- an array of PNG images
- Throws:
java.io.IOException
-
splitPdf
public static void splitPdf(java.io.File inputPdfFile, java.io.File outputPdfFile, int firstPage, int lastPage)
Splits PDF.- Parameters:
inputPdfFile
- input fileoutputPdfFile
- output filefirstPage
- begin pagelastPage
- end page
-
getPdfPageCount
public static int getPdfPageCount(java.io.File inputPdfFile)
Gets PDF Page Count.- Parameters:
inputPdfFile
- input file- Returns:
- number of pages
-
mergePdf
public static void mergePdf(java.io.File[] inputPdfFiles, java.io.File outputPdfFile)
Merges PDF files.- Parameters:
inputPdfFiles
- array of input filesoutputPdfFile
- output file
-
-