Class PDFBoxRenderer
- java.lang.Object
-
- org.apache.tika.renderer.pdf.pdfbox.PDFBoxRenderer
-
- All Implemented Interfaces:
Serializable,org.apache.tika.config.Initializable,PDDocumentRenderer,org.apache.tika.renderer.Renderer
public class PDFBoxRenderer extends Object implements PDDocumentRenderer, org.apache.tika.config.Initializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOGstatic org.apache.tika.metadata.PropertyPDFBOX_IMAGE_WRITING_TIME_MSThis is the amount of time it takes for PDFBox/java to write the image after it has been rendered into a BufferedImage.static org.apache.tika.metadata.PropertyPDFBOX_RENDERING_TIME_MSThis is the amount of time it takes for PDFBox to render the page to a BufferedImage
-
Constructor Summary
Constructors Constructor Description PDFBoxRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckInitialization(org.apache.tika.config.InitializableProblemHandler problemHandler)protected intgetDPI(org.apache.tika.parser.ParseContext parseContext)protected StringgetImageFormatName(org.apache.tika.parser.ParseContext parseContext)protected org.apache.pdfbox.rendering.ImageTypegetImageType(org.apache.tika.parser.ParseContext parseContext)Set<org.apache.tika.mime.MediaType>getSupportedTypes(org.apache.tika.parser.ParseContext context)voidinitialize(Map<String,org.apache.tika.config.Param> params)org.apache.tika.renderer.RenderResultsrender(InputStream is, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext parseContext, org.apache.tika.renderer.RenderRequest... requests)protected org.apache.tika.renderer.RenderResultrenderPage(org.apache.pdfbox.rendering.PDFRenderer renderer, int id, int pageNumber, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext parseContext)voidsetDPI(int dpi)voidsetImageFormatName(String imageFormatName)voidsetImageType(org.apache.pdfbox.rendering.ImageType imageType)
-
-
-
Field Detail
-
LOG
protected static final org.slf4j.Logger LOG
-
PDFBOX_RENDERING_TIME_MS
public static org.apache.tika.metadata.Property PDFBOX_RENDERING_TIME_MS
This is the amount of time it takes for PDFBox to render the page to a BufferedImage
-
PDFBOX_IMAGE_WRITING_TIME_MS
public static org.apache.tika.metadata.Property PDFBOX_IMAGE_WRITING_TIME_MS
This is the amount of time it takes for PDFBox/java to write the image after it has been rendered into a BufferedImage. Some formats take much longer to encode than others.
-
-
Method Detail
-
getSupportedTypes
public Set<org.apache.tika.mime.MediaType> getSupportedTypes(org.apache.tika.parser.ParseContext context)
- Specified by:
getSupportedTypesin interfaceorg.apache.tika.renderer.Renderer
-
render
public org.apache.tika.renderer.RenderResults render(InputStream is, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext parseContext, org.apache.tika.renderer.RenderRequest... requests) throws IOException, org.apache.tika.exception.TikaException
- Specified by:
renderin interfaceorg.apache.tika.renderer.Renderer- Throws:
IOExceptionorg.apache.tika.exception.TikaException
-
renderPage
protected org.apache.tika.renderer.RenderResult renderPage(org.apache.pdfbox.rendering.PDFRenderer renderer, int id, int pageNumber, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext parseContext) throws IOException- Throws:
IOException
-
initialize
public void initialize(Map<String,org.apache.tika.config.Param> params) throws org.apache.tika.exception.TikaConfigException
- Specified by:
initializein interfaceorg.apache.tika.config.Initializable- Throws:
org.apache.tika.exception.TikaConfigException
-
checkInitialization
public void checkInitialization(org.apache.tika.config.InitializableProblemHandler problemHandler) throws org.apache.tika.exception.TikaConfigException- Specified by:
checkInitializationin interfaceorg.apache.tika.config.Initializable- Throws:
org.apache.tika.exception.TikaConfigException
-
setDPI
public void setDPI(int dpi)
-
setImageType
public void setImageType(org.apache.pdfbox.rendering.ImageType imageType)
-
setImageFormatName
public void setImageFormatName(String imageFormatName)
-
getDPI
protected int getDPI(org.apache.tika.parser.ParseContext parseContext)
-
getImageType
protected org.apache.pdfbox.rendering.ImageType getImageType(org.apache.tika.parser.ParseContext parseContext)
-
getImageFormatName
protected String getImageFormatName(org.apache.tika.parser.ParseContext parseContext)
-
-