Package org.apache.tika.parser.pdf.image
Class ImageGraphicsEngine
java.lang.Object
org.apache.pdfbox.contentstream.PDFStreamEngine
org.apache.pdfbox.contentstream.PDFGraphicsStreamEngine
org.apache.tika.parser.pdf.image.ImageGraphicsEngine
public class ImageGraphicsEngine
extends org.apache.pdfbox.contentstream.PDFGraphicsStreamEngine
Copied nearly verbatim from PDFBox
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EmbeddedDocumentExtractorprotected final booleanprotected final AtomicIntegerprotected static final longprotected final intprotected final Metadataprotected final ParseContextprotected final PDFParserConfigprotected booleanprotected final XHTMLContentHandler -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedImageGraphicsEngine(org.apache.pdfbox.pdmodel.PDPage page, int pageNumber, EmbeddedDocumentExtractor embeddedDocumentExtractor, PDFParserConfig pdfParserConfig, Map<org.apache.pdfbox.cos.COSStream, Integer> processedInlineImages, AtomicInteger imageCounter, XHTMLContentHandler xhtml, Metadata parentMetadata, ParseContext parseContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendRectangle(Point2D p0, Point2D p1, Point2D p2, Point2D p3) voidclip(int windingRule) voidprotected static voidcopyUpToMaxLength(InputStream is, OutputStream os) voidcurveTo(float x1, float y1, float x2, float y2, float x3, float y3) voiddrawImage(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage) voidendPath()protected voidextractInlineImageMetadataOnly(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage, Metadata metadata) voidfillAndStrokePath(int windingRule) voidfillPath(int windingRule) protected Stringprotected voidprotected static booleanhasMasks(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage) voidlineTo(float x, float y) voidmoveTo(float x, float y) protected voidprocessImage(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage, int imageNumber) voidrun()voidshadingFill(org.apache.pdfbox.cos.COSName shadingName) protected voidshowGlyph(org.apache.pdfbox.util.Matrix textRenderingMatrix, org.apache.pdfbox.pdmodel.font.PDFont font, int code, org.apache.pdfbox.util.Vector displacement) voidprotected BufferedImagewriteToBuffer(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage, String suffix, boolean directJPEG, OutputStream out) Methods inherited from class org.apache.pdfbox.contentstream.PDFGraphicsStreamEngine
getPageMethods inherited from class org.apache.pdfbox.contentstream.PDFStreamEngine
addOperator, applyTextAdjustment, beginMarkedContentSequence, beginText, decreaseLevel, endMarkedContentSequence, endText, getAppearance, getCurrentPage, getGraphicsStackSize, getGraphicsState, getInitialMatrix, getLevel, getResources, getTextLineMatrix, getTextMatrix, increaseLevel, isShouldProcessColorOperators, markedContentPoint, operatorException, processAnnotation, processChildStream, processOperator, processOperator, processPage, processSoftMask, processTilingPattern, processTilingPattern, processTransparencyGroup, processType3Stream, restoreGraphicsStack, restoreGraphicsState, saveGraphicsStack, saveGraphicsState, setLineDashPattern, setTextLineMatrix, setTextMatrix, showAnnotation, showFontGlyph, showForm, showText, showTextString, showTextStrings, showTransparencyGroup, showType3Glyph, transformedPoint, transformWidth, unsupportedOperator
-
Field Details
-
MAX_IMAGE_LENGTH_BYTES
protected static final long MAX_IMAGE_LENGTH_BYTES- See Also:
-
JPEG
-
JP2
-
JB2
-
pageNumber
protected final int pageNumber -
embeddedDocumentExtractor
-
pdfParserConfig
-
processedInlineImages
-
imageCounter
-
parentMetadata
-
xhtml
-
parseContext
-
extractInlineImageMetadataOnly
protected final boolean extractInlineImageMetadataOnly -
useDirectJPEG
protected boolean useDirectJPEG
-
-
Constructor Details
-
ImageGraphicsEngine
protected ImageGraphicsEngine(org.apache.pdfbox.pdmodel.PDPage page, int pageNumber, EmbeddedDocumentExtractor embeddedDocumentExtractor, PDFParserConfig pdfParserConfig, Map<org.apache.pdfbox.cos.COSStream, Integer> processedInlineImages, AtomicInteger imageCounter, XHTMLContentHandler xhtml, Metadata parentMetadata, ParseContext parseContext)
-
-
Method Details
-
writeToBuffer
protected BufferedImage writeToBuffer(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage, String suffix, boolean directJPEG, OutputStream out) throws IOException, TikaException - Throws:
IOExceptionTikaException
-
copyUpToMaxLength
protected static void copyUpToMaxLength(InputStream is, OutputStream os) throws IOException, TikaException - Throws:
IOExceptionTikaException
-
hasMasks
protected static boolean hasMasks(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage) throws IOException - Throws:
IOException
-
run
- Throws:
IOException
-
drawImage
- Specified by:
drawImagein classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
appendRectangle
- Specified by:
appendRectanglein classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
clip
- Specified by:
clipin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
moveTo
- Specified by:
moveToin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
lineTo
- Specified by:
lineToin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
curveTo
- Specified by:
curveToin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
getCurrentPoint
- Specified by:
getCurrentPointin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
closePath
- Specified by:
closePathin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
endPath
- Specified by:
endPathin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
showGlyph
protected void showGlyph(org.apache.pdfbox.util.Matrix textRenderingMatrix, org.apache.pdfbox.pdmodel.font.PDFont font, int code, org.apache.pdfbox.util.Vector displacement) throws IOException - Overrides:
showGlyphin classorg.apache.pdfbox.contentstream.PDFStreamEngine- Throws:
IOException
-
strokePath
- Specified by:
strokePathin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
fillPath
- Specified by:
fillPathin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
fillAndStrokePath
- Specified by:
fillAndStrokePathin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
shadingFill
- Specified by:
shadingFillin classorg.apache.pdfbox.contentstream.PDFGraphicsStreamEngine- Throws:
IOException
-
processImage
protected void processImage(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage, int imageNumber) throws IOException, TikaException, SAXException - Throws:
IOExceptionTikaExceptionSAXException
-
extractInlineImageMetadataOnly
protected void extractInlineImageMetadataOnly(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage, Metadata metadata) throws IOException, SAXException - Throws:
IOExceptionSAXException
-
getSuffix
protected String getSuffix(org.apache.pdfbox.pdmodel.graphics.image.PDImage pdImage, Metadata metadata) throws IOException - Throws:
IOException
-
handleCatchableIOE
- Throws:
IOException
-
getExceptions
-