Package net.sourceforge.tess4j.util
Class PdfBoxUtilities
java.lang.Object
net.sourceforge.tess4j.util.PdfBoxUtilities
PDF utilities based on PDFBox.
- Author:
- Robert Drysdale, Quan Nguyen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic File[]
convertPdf2Png
(File inputPdfFile) Converts PDF to PNG format.static File
convertPdf2Tiff
(File inputPdfFile) Converts PDF to TIFF format.static int
getPdfPageCount
(File inputPdfFile) Gets PDF Page Count.static void
mergeHocrIntoAPdf
(String inputHocr, String inputPdfStr, String outputPdfStr, boolean visible) Merge text from hocr file into a pdfstatic void
Merges PDF files.static void
Splits PDF.
-
Constructor Details
-
PdfBoxUtilities
public PdfBoxUtilities()
-
-
Method Details
-
convertPdf2Tiff
Converts PDF to TIFF format.- Parameters:
inputPdfFile
- input file- Returns:
- a multi-page TIFF image
- Throws:
IOException
-
convertPdf2Png
Converts PDF to PNG format.- Parameters:
inputPdfFile
- input file- Returns:
- an array of PNG images
- Throws:
IOException
-
splitPdf
Splits PDF.- Parameters:
inputPdfFile
- input fileoutputPdfFile
- output filefirstPage
- begin pagelastPage
- end page
-
getPdfPageCount
Gets PDF Page Count.- Parameters:
inputPdfFile
- input file- Returns:
- number of pages
-
mergePdf
Merges PDF files.- Parameters:
inputPdfFiles
- array of input filesoutputPdfFile
- output file
-
mergeHocrIntoAPdf
public static void mergeHocrIntoAPdf(String inputHocr, String inputPdfStr, String outputPdfStr, boolean visible) throws Exception Merge text from hocr file into a pdf- Parameters:
inputHocr
- input hocr fileinputPdfStr
- input pdf fileoutputPdfStr
- ouput pdf file result of mergingvisible
- does the text are visible or not- Throws:
Exception
-