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
private static class CustomPageDrawer.MyPageDrawer extends PageDrawer
Example PageDrawer subclass with custom rendering.
-
-
Constructor Summary
Constructors Constructor Description MyPageDrawer(PageDrawerParameters parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfillPath(int windingRule)Filled path bounding boxes.protected java.awt.PaintgetPaint(PDColor color)Color replacement.voidshowAnnotation(PDAnnotation annotation)Custom annotation rendering.protected voidshowGlyph(Matrix textRenderingMatrix, PDFont font, int code, Vector displacement)Glyph 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, transferClip
-
Methods inherited from class org.apache.pdfbox.contentstream.PDFGraphicsStreamEngine
getPage
-
Methods 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 Detail
-
MyPageDrawer
MyPageDrawer(PageDrawerParameters parameters) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
getPaint
protected java.awt.Paint getPaint(PDColor color) throws java.io.IOException
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:
java.io.IOException- if the AWT paint could not be created
-
showGlyph
protected void showGlyph(Matrix textRenderingMatrix, PDFont font, int code, Vector displacement) throws java.io.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:
java.io.IOException- if the glyph cannot be processed
-
fillPath
public void fillPath(int windingRule) throws java.io.IOExceptionFilled path bounding boxes.- Overrides:
fillPathin classPageDrawer- Parameters:
windingRule- The winding rule this path will use.- Throws:
java.io.IOException- if the path could not be filled
-
showAnnotation
public void showAnnotation(PDAnnotation annotation) throws java.io.IOException
Custom annotation rendering.- Overrides:
showAnnotationin classPageDrawer- Parameters:
annotation- An annotation on the current page.- Throws:
java.io.IOException- If an error occurred reading the annotation
-
-