Class PDFBoxRenderer
java.lang.Object
org.apache.tika.renderer.pdf.pdfbox.PDFBoxRenderer
- All Implemented Interfaces:
Serializable
,Initializable
,PDDocumentRenderer
,Renderer
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final org.slf4j.Logger
static Property
This is the amount of time it takes for PDFBox/java to write the image after it has been rendered into a BufferedImage.static Property
This is the amount of time it takes for PDFBox to render the page to a BufferedImage -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkInitialization
(InitializableProblemHandler problemHandler) protected int
getDPI
(ParseContext parseContext) protected String
getImageFormatName
(ParseContext parseContext) protected org.apache.pdfbox.rendering.ImageType
getImageType
(ParseContext parseContext) getSupportedTypes
(ParseContext context) Returns the set of media types supported by this renderer when used with the given parse context.void
initialize
(Map<String, Param> params) render
(InputStream is, Metadata metadata, ParseContext parseContext, RenderRequest... requests) protected RenderResult
renderPage
(org.apache.pdfbox.rendering.PDFRenderer renderer, int id, int pageNumber, Metadata metadata, ParseContext parseContext) void
setDPI
(int dpi) void
setImageFormatName
(String imageFormatName) void
setImageType
(org.apache.pdfbox.rendering.ImageType imageType)
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOG -
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
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.
-
-
Constructor Details
-
PDFBoxRenderer
public PDFBoxRenderer()
-
-
Method Details
-
getSupportedTypes
Description copied from interface:Renderer
Returns the set of media types supported by this renderer when used with the given parse context.- Specified by:
getSupportedTypes
in interfaceRenderer
- Parameters:
context
- parse context- Returns:
- immutable set of media types
-
render
public RenderResults render(InputStream is, Metadata metadata, ParseContext parseContext, RenderRequest... requests) throws IOException, TikaException - Specified by:
render
in interfaceRenderer
- Throws:
IOException
TikaException
-
renderPage
protected RenderResult renderPage(org.apache.pdfbox.rendering.PDFRenderer renderer, int id, int pageNumber, Metadata metadata, ParseContext parseContext) throws IOException - Throws:
IOException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Parameters:
params
- params to use for initialization- Throws:
TikaConfigException
-
checkInitialization
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException - Specified by:
checkInitialization
in interfaceInitializable
- Parameters:
problemHandler
- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.- Throws:
TikaConfigException
-
setDPI
public void setDPI(int dpi) -
setImageType
public void setImageType(org.apache.pdfbox.rendering.ImageType imageType) -
setImageFormatName
-
getDPI
-
getImageType
-
getImageFormatName
-