Class CustomPageDrawer.MyPageDrawer
java.lang.Object
org.apache.pdfbox.contentstream.PDFStreamEngine
org.apache.pdfbox.contentstream.PDFGraphicsStreamEngine
org.apache.pdfbox.rendering.PageDrawer
org.apache.pdfbox.examples.rendering.CustomPageDrawer.MyPageDrawer
- Enclosing class:
CustomPageDrawer
Example PageDrawer subclass with custom rendering.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfillPath(int windingRule) Filled path bounding boxes.protected PaintColor replacement.voidshowAnnotation(PDAnnotation annotation) Custom annotation rendering.protected voidGlyph bounding boxes.Methods inherited from class org.apache.pdfbox.rendering.PageDrawer
appendRectangle, beginMarkedContentSequence, beginText, clip, closePath, curveTo, drawImage, drawPage, endMarkedContentSequence, endPath, endText, fillAndStrokePath, getAnnotationFilter, getCurrentPoint, getGraphics, getLinePath, getNonStrokingPaint, getRenderer, getSubsampling, lineTo, moveTo, setAnnotationFilter, setClip, shadingFill, showFontGlyph, showForm, showTransparencyGroup, showTransparencyGroupOnGraphics, showType3Glyph, strokePath, transferClipMethods inherited from class org.apache.pdfbox.contentstream.PDFGraphicsStreamEngine
getPageMethods inherited from class org.apache.pdfbox.contentstream.PDFStreamEngine
addOperator, applyTextAdjustment, decreaseLevel, 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, showText, showTextString, showTextStrings, transformedPoint, transformWidth, unsupportedOperator
-
Constructor Details
-
MyPageDrawer
MyPageDrawer(PageDrawerParameters parameters) throws IOException - Throws:
IOException
-
-
Method Details
-
getPaint
Color replacement.- Overrides:
getPaintin classPageDrawer- Parameters:
color- The color to get a paint for. This can be an actual color or a pattern.- Returns:
- an AWT paint for the given PDColor
- Throws:
IOException- if the AWT paint could not be created
-
showGlyph
protected void showGlyph(Matrix textRenderingMatrix, PDFont font, int code, Vector displacement) throws IOException Glyph bounding boxes.- Overrides:
showGlyphin classPDFStreamEngine- Parameters:
textRenderingMatrix- the current text rendering matrix, Trmfont- the current fontcode- internal PDF character code for the glyphdisplacement- the displacement (i.e. advance) of the glyph in text space- Throws:
IOException- if the glyph cannot be processed
-
fillPath
Filled path bounding boxes.- Overrides:
fillPathin classPageDrawer- Parameters:
windingRule- The winding rule this path will use.- Throws:
IOException- if the path could not be filled
-
showAnnotation
Custom annotation rendering.- Overrides:
showAnnotationin classPageDrawer- Parameters:
annotation- An annotation on the current page.- Throws:
IOException- If an error occurred reading the annotation
-