Package com.openhtmltopdf.pdfboxout
Class PdfBoxSlowOutputDevice
- java.lang.Object
-
- com.openhtmltopdf.render.AbstractOutputDevice
-
- com.openhtmltopdf.pdfboxout.PdfBoxSlowOutputDevice
-
- All Implemented Interfaces:
OutputDevice,PdfBoxOutputDevice
public class PdfBoxSlowOutputDevice extends AbstractOutputDevice implements OutputDevice, PdfBoxOutputDevice
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classPdfBoxSlowOutputDevice.Bookmarkstatic classPdfBoxSlowOutputDevice.FontRun(package private) static classPdfBoxSlowOutputDevice.Metadata
-
Field Summary
Fields Modifier and Type Field Description private float_absoluteTransformOriginXprivate float_absoluteTransformOriginYprivate java.util.List<PdfBoxSlowOutputDevice.Bookmark>_bookmarksprivate java.awt.geom.Area_clipprivate FSColor_colorprivate PdfContentStreamAdapter_cpprivate org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination_defaultDestinationprivate float_dotsPerPointprivate FSColor_fillColorprivate PdfBoxFSFont_fontprivate de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DFontTextDrawer_fontTextDrawerprivate PdfBoxPerDocumentFormState_formStateprivate PdfBoxLinkManager_linkManagerprivate java.util.List<PdfBoxSlowOutputDevice.Metadata>_metadataprivate java.awt.Stroke_oldStrokeprivate java.awt.Stroke_originalStrokeprivate org.apache.pdfbox.pdmodel.PDPage_pageprivate float_pageHeightprivate RenderingContext_renderingContextprivate BidiReorderer_reordererprivate Box_rootprivate SharedContext_sharedContextprivate int_startPageNoprivate java.awt.Stroke_strokeprivate FSColor_strokeColorprivate boolean_testModeprivate java.awt.geom.AffineTransform_transformprivate org.apache.pdfbox.pdmodel.PDDocument_writerprivate static intCLIPprivate intclipTransformIndexprivate static intFILLprivate static java.awt.geom.AffineTransformIDENTITYprivate static booleanROUND_RECT_DIMENSIONS_DOWNprivate static intSTROKEprivate static java.awt.BasicStrokeSTROKE_ONEprivate java.util.Deque<java.awt.geom.AffineTransform>transformStack
-
Constructor Summary
Constructors Constructor Description PdfBoxSlowOutputDevice(float dotsPerPoint, boolean testMode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMetadata(java.lang.String name, java.lang.String value)Appends a name/content metadata pair to this output device.private PagePosition<Box>calcPDFPagePosition(CssContext c, java.lang.String id, Box box)private voidclearPageState()voidclip(java.awt.Shape s)voidclose()Perform any internal cleanup neededvoiddraw(java.awt.Shape s)voiddrawBorderLine(java.awt.Shape bounds, int side, int lineWidth, boolean solid)voiddrawImage(FSImage fsImage, int x, int y, boolean interpolate)protected voiddrawLine(int x1, int y1, int x2, int y2)voiddrawOval(int x, int y, int width, int height)voiddrawPdfAsImage(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject _src, java.awt.Rectangle contentBounds, float intrinsicWidth, float intrinsicHeight)voiddrawRect(int x, int y, int width, int height)voiddrawSelection(RenderingContext c, InlineText inlineText)voiddrawString(java.lang.String s, float x, float y, JustificationInfo info)voiddrawStringFast(java.lang.String s, float x, float y, JustificationInfo info, PdfBoxFontResolver.FontDescription desc, float fontSize)voiddrawWithGraphics(float x, float y, float width, float height, OutputDeviceGraphicsDrawer renderer)Draw something using a Graphics2D at the given rectangle.voidendStructure(java.lang.Object token)private voidensureFillColor()private voidensureStrokeColor()voidfill(java.awt.Shape s)voidfillOval(int x, int y, int width, int height)voidfillRect(int x, int y, int width, int height)java.util.List<PagePosition<Box>>findPagePositionsByID(CssContext c, java.util.regex.Pattern pattern)voidfinish(RenderingContext c, Box root)voidfinishPage()private voidfollowPath(java.awt.Shape s, int drawType)floatgetAbsoluteTransformOriginX()floatgetAbsoluteTransformOriginY()java.awt.ShapegetClip()PdfContentStreamAdaptergetCurrentPage()floatgetDeviceLength(float length)Given a value in dots units, converts to PDF points.floatgetDotsPerPoint()java.util.List<PdfBoxSlowOutputDevice.Metadata>getMetadata()java.lang.StringgetMetadataByName(java.lang.String name)Searches the metadata name/content pairs of the current document and returns the content value from the first pair with a matching name.java.util.List<java.lang.String>getMetadataListByName(java.lang.String name)Searches the metadata name/content pairs of the current document and returns any content values with a matching name in an ArrayList.org.apache.pdfbox.pdmodel.PDPagegetPage()intgetPageRefY(Box box)java.lang.ObjectgetRenderingHint(java.awt.RenderingHints.Key key)SharedContextgetSharedContext()intgetStartPageNo()java.awt.StrokegetStroke()private java.awt.geom.AffineTransformgetTransform()org.apache.pdfbox.pdmodel.PDDocumentgetWriter()private voidhandleBookmarksInParent(org.w3c.dom.Element element)voidinitializePage(org.apache.pdfbox.pdmodel.PDPageContentStream currentPage, org.apache.pdfbox.pdmodel.PDPage page, float height)Start a page.booleanisFastRenderer()The new (2018) fast renderer is in use.booleanisPDF()booleanisSupportsCMYKColors()booleanisSupportsSelection()private voidloadBookmark(PdfBoxSlowOutputDevice.Bookmark parent, org.w3c.dom.Element bookmark)private voidloadBookmarks(org.w3c.dom.Document doc)private voidloadMetadata(org.w3c.dom.Document doc)Locates and stores all metadata values in the document head that contain name/content pairs.private java.lang.Object[]makeJustificationArray(java.lang.String s, JustificationInfo info)private java.awt.geom.AffineTransformnormalizeMatrix(java.awt.geom.AffineTransform current)This returns a matrix that will convert y values to bottom up coordinate space (as used by PDFs).private java.awt.geom.AffineTransformnormalizeTransform(java.awt.geom.AffineTransform transform)private floatnormalizeY(float y)Converts a top down unit to a bottom up PDF unit for the current page.private voidnormalizeY(float[] coords)floatnormalizeY(float y, float pageHeight)Converts a top down unit to a bottom up PDF unit for the specified page height.voidpaintBackground(RenderingContext c, Box box)We use paintBackground to do extra stuff such as processing links, forms and form controls.voidpaintReplacedElement(RenderingContext c, BlockBox box)voidpopClip()Reverts the last clip on the stack.voidpopTransformLayer()Reverts the transform on the stack.voidpopTransforms(java.util.List<java.awt.geom.AffineTransform> inverse)private voidprocessControls()voidpushClip(java.awt.Shape s)Applies a clip on the output device.voidpushTransformLayer(java.awt.geom.AffineTransform transform)Applies a transform on the output device.java.util.List<java.awt.geom.AffineTransform>pushTransforms(java.util.List<java.awt.geom.AffineTransform> transforms)Apply the given transform on top of the current one in the PDF graphics stream.voidrealizeImage(PdfBoxImage img)private voidreapplyTransforms()voidsetBidiReorderer(BidiReorderer reorderer)voidsetClip(java.awt.Shape s)voidsetColor(FSColor color)voidsetFont(FSFont font)voidsetMetadata(java.lang.String name, java.lang.String value)Replaces all copies of the named metadata with a single value.voidsetPaint(java.awt.Paint paint)voidsetRenderingContext(RenderingContext result)voidsetRenderingHint(java.awt.RenderingHints.Key key, java.lang.Object value)voidsetRoot(Box root)voidsetSharedContext(SharedContext sharedContext)voidsetStartPageNo(int startPageNo)voidsetStroke(java.awt.Stroke s)private voidsetStrokeDiff(java.awt.Stroke newStroke, java.awt.Stroke oldStroke)voidsetWriter(org.apache.pdfbox.pdmodel.PDDocument writer)voidstart(org.w3c.dom.Document doc)java.lang.ObjectstartStructure(StructureType type, Box box)Propagate the structure heirachy to allow for PDF/UA compliance.private java.awt.StroketransformStroke(java.awt.Stroke stroke)voidtranslate(double tx, double ty)private voidwriteBookmark(RenderingContext c, Box root, org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineNode parent, PdfBoxSlowOutputDevice.Bookmark bookmark)private voidwriteBookmarks(RenderingContext c, Box root, org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineNode parent, java.util.List<PdfBoxSlowOutputDevice.Bookmark> bookmarks)private voidwriteOutline(RenderingContext c, Box root)-
Methods inherited from class com.openhtmltopdf.render.AbstractOutputDevice
drawDebugOutline, drawText, drawTextDecoration, drawTextDecoration, getFontSpecification, paintBackground, paintBorder, paintBorder, paintCollapsedBorder, setFontSpecification
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.openhtmltopdf.extend.OutputDevice
drawDebugOutline, drawLinearGradient, drawText, drawTextDecoration, drawTextDecoration, paintBackground, paintBorder, paintBorder, paintCollapsedBorder
-
-
-
-
Field Detail
-
FILL
private static final int FILL
- See Also:
- Constant Field Values
-
STROKE
private static final int STROKE
- See Also:
- Constant Field Values
-
CLIP
private static final int CLIP
- See Also:
- Constant Field Values
-
IDENTITY
private static final java.awt.geom.AffineTransform IDENTITY
-
STROKE_ONE
private static final java.awt.BasicStroke STROKE_ONE
-
ROUND_RECT_DIMENSIONS_DOWN
private static final boolean ROUND_RECT_DIMENSIONS_DOWN
-
_page
private org.apache.pdfbox.pdmodel.PDPage _page
-
_cp
private PdfContentStreamAdapter _cp
-
_pageHeight
private float _pageHeight
-
_font
private PdfBoxFSFont _font
-
_transform
private java.awt.geom.AffineTransform _transform
-
transformStack
private final java.util.Deque<java.awt.geom.AffineTransform> transformStack
-
clipTransformIndex
private int clipTransformIndex
-
_absoluteTransformOriginX
private float _absoluteTransformOriginX
-
_absoluteTransformOriginY
private float _absoluteTransformOriginY
-
_color
private FSColor _color
-
_fillColor
private FSColor _fillColor
-
_strokeColor
private FSColor _strokeColor
-
_stroke
private java.awt.Stroke _stroke
-
_originalStroke
private java.awt.Stroke _originalStroke
-
_oldStroke
private java.awt.Stroke _oldStroke
-
_clip
private java.awt.geom.Area _clip
-
_sharedContext
private SharedContext _sharedContext
-
_dotsPerPoint
private float _dotsPerPoint
-
_writer
private org.apache.pdfbox.pdmodel.PDDocument _writer
-
_defaultDestination
private org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDDestination _defaultDestination
-
_bookmarks
private final java.util.List<PdfBoxSlowOutputDevice.Bookmark> _bookmarks
-
_metadata
private final java.util.List<PdfBoxSlowOutputDevice.Metadata> _metadata
-
_formState
private final PdfBoxPerDocumentFormState _formState
-
_root
private Box _root
-
_startPageNo
private int _startPageNo
-
_testMode
private final boolean _testMode
-
_linkManager
private PdfBoxLinkManager _linkManager
-
_renderingContext
private RenderingContext _renderingContext
-
_reorderer
private BidiReorderer _reorderer
-
_fontTextDrawer
private de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DFontTextDrawer _fontTextDrawer
-
-
Method Detail
-
setWriter
public void setWriter(org.apache.pdfbox.pdmodel.PDDocument writer)
- Specified by:
setWriterin interfacePdfBoxOutputDevice
-
getWriter
public org.apache.pdfbox.pdmodel.PDDocument getWriter()
- Specified by:
getWriterin interfacePdfBoxOutputDevice
-
initializePage
public void initializePage(org.apache.pdfbox.pdmodel.PDPageContentStream currentPage, org.apache.pdfbox.pdmodel.PDPage page, float height)Start a page. A new PDF page starts a new content stream so all graphics state has to be set back to default.- Specified by:
initializePagein interfacePdfBoxOutputDevice
-
finishPage
public void finishPage()
- Specified by:
finishPagein interfacePdfBoxOutputDevice
-
paintReplacedElement
public void paintReplacedElement(RenderingContext c, BlockBox box)
- Specified by:
paintReplacedElementin interfaceOutputDevice- Specified by:
paintReplacedElementin interfacePdfBoxOutputDevice
-
paintBackground
public void paintBackground(RenderingContext c, Box box)
We use paintBackground to do extra stuff such as processing links, forms and form controls.- Specified by:
paintBackgroundin interfaceOutputDevice- Specified by:
paintBackgroundin interfacePdfBoxOutputDevice- Overrides:
paintBackgroundin classAbstractOutputDevice
-
processControls
private void processControls()
-
getDeviceLength
public float getDeviceLength(float length)
Given a value in dots units, converts to PDF points.- Specified by:
getDeviceLengthin interfacePdfBoxOutputDevice
-
drawBorderLine
public void drawBorderLine(java.awt.Shape bounds, int side, int lineWidth, boolean solid)- Specified by:
drawBorderLinein interfaceOutputDevice- Specified by:
drawBorderLinein interfacePdfBoxOutputDevice
-
setColor
public void setColor(FSColor color)
- Specified by:
setColorin interfaceOutputDevice- Specified by:
setColorin interfacePdfBoxOutputDevice
-
draw
public void draw(java.awt.Shape s)
- Specified by:
drawin interfaceOutputDevice- Specified by:
drawin interfacePdfBoxOutputDevice
-
drawLine
protected void drawLine(int x1, int y1, int x2, int y2)- Specified by:
drawLinein classAbstractOutputDevice
-
drawRect
public void drawRect(int x, int y, int width, int height)- Specified by:
drawRectin interfaceOutputDevice- Specified by:
drawRectin interfacePdfBoxOutputDevice
-
drawOval
public void drawOval(int x, int y, int width, int height)- Specified by:
drawOvalin interfaceOutputDevice- Specified by:
drawOvalin interfacePdfBoxOutputDevice
-
fill
public void fill(java.awt.Shape s)
- Specified by:
fillin interfaceOutputDevice- Specified by:
fillin interfacePdfBoxOutputDevice
-
fillRect
public void fillRect(int x, int y, int width, int height)- Specified by:
fillRectin interfaceOutputDevice- Specified by:
fillRectin interfacePdfBoxOutputDevice
-
fillOval
public void fillOval(int x, int y, int width, int height)- Specified by:
fillOvalin interfaceOutputDevice- Specified by:
fillOvalin interfacePdfBoxOutputDevice
-
translate
public void translate(double tx, double ty)- Specified by:
translatein interfaceOutputDevice- Specified by:
translatein interfacePdfBoxOutputDevice
-
getRenderingHint
public java.lang.Object getRenderingHint(java.awt.RenderingHints.Key key)
- Specified by:
getRenderingHintin interfaceOutputDevice- Specified by:
getRenderingHintin interfacePdfBoxOutputDevice
-
setRenderingHint
public void setRenderingHint(java.awt.RenderingHints.Key key, java.lang.Object value)- Specified by:
setRenderingHintin interfaceOutputDevice- Specified by:
setRenderingHintin interfacePdfBoxOutputDevice
-
setFont
public void setFont(FSFont font)
- Specified by:
setFontin interfaceOutputDevice- Specified by:
setFontin interfacePdfBoxOutputDevice
-
normalizeMatrix
private java.awt.geom.AffineTransform normalizeMatrix(java.awt.geom.AffineTransform current)
This returns a matrix that will convert y values to bottom up coordinate space (as used by PDFs).
-
drawString
public void drawString(java.lang.String s, float x, float y, JustificationInfo info)- Specified by:
drawStringin interfacePdfBoxOutputDevice
-
drawStringFast
public void drawStringFast(java.lang.String s, float x, float y, JustificationInfo info, PdfBoxFontResolver.FontDescription desc, float fontSize)- Specified by:
drawStringFastin interfacePdfBoxOutputDevice
-
makeJustificationArray
private java.lang.Object[] makeJustificationArray(java.lang.String s, JustificationInfo info)
-
getTransform
private java.awt.geom.AffineTransform getTransform()
-
ensureFillColor
private void ensureFillColor()
-
ensureStrokeColor
private void ensureStrokeColor()
-
getCurrentPage
public PdfContentStreamAdapter getCurrentPage()
- Specified by:
getCurrentPagein interfacePdfBoxOutputDevice
-
getPage
public org.apache.pdfbox.pdmodel.PDPage getPage()
- Specified by:
getPagein interfacePdfBoxOutputDevice
-
followPath
private void followPath(java.awt.Shape s, int drawType)
-
normalizeY
private float normalizeY(float y)
Converts a top down unit to a bottom up PDF unit for the current page.
-
normalizeY
public float normalizeY(float y, float pageHeight)Converts a top down unit to a bottom up PDF unit for the specified page height.- Specified by:
normalizeYin interfacePdfBoxOutputDevice
-
normalizeY
private void normalizeY(float[] coords)
-
setStrokeDiff
private void setStrokeDiff(java.awt.Stroke newStroke, java.awt.Stroke oldStroke)
-
setStroke
public void setStroke(java.awt.Stroke s)
- Specified by:
setStrokein interfaceOutputDevice- Specified by:
setStrokein interfacePdfBoxOutputDevice
-
transformStroke
private java.awt.Stroke transformStroke(java.awt.Stroke stroke)
-
clip
public void clip(java.awt.Shape s)
- Specified by:
clipin interfaceOutputDevice- Specified by:
clipin interfacePdfBoxOutputDevice
-
getClip
public java.awt.Shape getClip()
- Specified by:
getClipin interfaceOutputDevice- Specified by:
getClipin interfacePdfBoxOutputDevice
-
popClip
public void popClip()
Description copied from interface:OutputDeviceReverts the last clip on the stack. The fast renderer MUST usepushClipandpopClipin preference toclipandsetClip. NOTE: The current implementation shares a stack between transforms and clips, so calls toOutputDevice.pushTransformLayer(AffineTransform),OutputDevice.popTransformLayer(),OutputDevice.pushClip(Shape)andOutputDevice.popClip()MUST be nested correctly.- Specified by:
popClipin interfaceOutputDevice- Specified by:
popClipin interfacePdfBoxOutputDevice
-
pushClip
public void pushClip(java.awt.Shape s)
Description copied from interface:OutputDeviceApplies a clip on the output device. This is a cumulative operation. The fast renderer MUST usepushClipandpopClipin preference toclipandsetClip. NOTE: The current implementation shares a stack between transforms and clips, so calls toOutputDevice.pushTransformLayer(AffineTransform),OutputDevice.popTransformLayer(),OutputDevice.pushClip(Shape)andOutputDevice.popClip()MUST be nested correctly.- Specified by:
pushClipin interfaceOutputDevice- Specified by:
pushClipin interfacePdfBoxOutputDevice
-
setClip
public void setClip(java.awt.Shape s)
- Specified by:
setClipin interfaceOutputDevice- Specified by:
setClipin interfacePdfBoxOutputDevice
-
getStroke
public java.awt.Stroke getStroke()
- Specified by:
getStrokein interfaceOutputDevice- Specified by:
getStrokein interfacePdfBoxOutputDevice
-
realizeImage
public void realizeImage(PdfBoxImage img)
- Specified by:
realizeImagein interfacePdfBoxOutputDevice
-
drawImage
public void drawImage(FSImage fsImage, int x, int y, boolean interpolate)
- Specified by:
drawImagein interfaceOutputDevice- Specified by:
drawImagein interfacePdfBoxOutputDevice
-
drawPdfAsImage
public void drawPdfAsImage(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject _src, java.awt.Rectangle contentBounds, float intrinsicWidth, float intrinsicHeight)- Specified by:
drawPdfAsImagein interfacePdfBoxOutputDevice
-
getDotsPerPoint
public float getDotsPerPoint()
- Specified by:
getDotsPerPointin interfacePdfBoxOutputDevice
-
start
public void start(org.w3c.dom.Document doc)
- Specified by:
startin interfacePdfBoxOutputDevice
-
finish
public void finish(RenderingContext c, Box root)
- Specified by:
finishin interfacePdfBoxOutputDevice
-
writeOutline
private void writeOutline(RenderingContext c, Box root)
-
writeBookmarks
private void writeBookmarks(RenderingContext c, Box root, org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineNode parent, java.util.List<PdfBoxSlowOutputDevice.Bookmark> bookmarks)
-
getPageRefY
public int getPageRefY(Box box)
- Specified by:
getPageRefYin interfacePdfBoxOutputDevice
-
writeBookmark
private void writeBookmark(RenderingContext c, Box root, org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineNode parent, PdfBoxSlowOutputDevice.Bookmark bookmark)
-
loadBookmarks
private void loadBookmarks(org.w3c.dom.Document doc)
-
handleBookmarksInParent
private void handleBookmarksInParent(org.w3c.dom.Element element)
-
loadBookmark
private void loadBookmark(PdfBoxSlowOutputDevice.Bookmark parent, org.w3c.dom.Element bookmark)
-
addMetadata
public void addMetadata(java.lang.String name, java.lang.String value)Appends a name/content metadata pair to this output device. A name or content value of null will be ignored.- Specified by:
addMetadatain interfacePdfBoxOutputDevice- Parameters:
name- the name of the metadata element to add.
-
getMetadataByName
public java.lang.String getMetadataByName(java.lang.String name)
Searches the metadata name/content pairs of the current document and returns the content value from the first pair with a matching name. The search is case insensitive.- Specified by:
getMetadataByNamein interfacePdfBoxOutputDevice- Parameters:
name- the metadata element name to locate.- Returns:
- the content value of the first found metadata element; otherwise null.
-
getMetadataListByName
public java.util.List<java.lang.String> getMetadataListByName(java.lang.String name)
Searches the metadata name/content pairs of the current document and returns any content values with a matching name in an ArrayList. The search is case insensitive.- Specified by:
getMetadataListByNamein interfacePdfBoxOutputDevice- Parameters:
name- the metadata element name to locate.- Returns:
- an ArrayList with matching content values; otherwise an empty list.
-
loadMetadata
private void loadMetadata(org.w3c.dom.Document doc)
Locates and stores all metadata values in the document head that contain name/content pairs. If there is no pair with a name of "title", any content in the title element is saved as a "title" metadata item.- Parameters:
doc- the Document level node of the parsed xhtml file.
-
setMetadata
public void setMetadata(java.lang.String name, java.lang.String value)Replaces all copies of the named metadata with a single value. A a new value of null will result in the removal of all copies of the named metadata. UseaddMetadatato append additional values with the same name.- Specified by:
setMetadatain interfacePdfBoxOutputDevice- Parameters:
name- the metadata element name to locate.
-
getMetadata
public java.util.List<PdfBoxSlowOutputDevice.Metadata> getMetadata()
- Specified by:
getMetadatain interfacePdfBoxOutputDevice- Returns:
- All metadata entries
-
getSharedContext
public SharedContext getSharedContext()
- Specified by:
getSharedContextin interfacePdfBoxOutputDevice
-
setSharedContext
public void setSharedContext(SharedContext sharedContext)
- Specified by:
setSharedContextin interfacePdfBoxOutputDevice
-
setRoot
public void setRoot(Box root)
- Specified by:
setRootin interfacePdfBoxOutputDevice
-
getStartPageNo
public int getStartPageNo()
- Specified by:
getStartPageNoin interfacePdfBoxOutputDevice
-
setStartPageNo
public void setStartPageNo(int startPageNo)
- Specified by:
setStartPageNoin interfacePdfBoxOutputDevice
-
drawSelection
public void drawSelection(RenderingContext c, InlineText inlineText)
- Specified by:
drawSelectionin interfaceOutputDevice- Specified by:
drawSelectionin interfacePdfBoxOutputDevice
-
isSupportsSelection
public boolean isSupportsSelection()
- Specified by:
isSupportsSelectionin interfaceOutputDevice- Specified by:
isSupportsSelectionin interfacePdfBoxOutputDevice
-
isSupportsCMYKColors
public boolean isSupportsCMYKColors()
- Specified by:
isSupportsCMYKColorsin interfaceOutputDevice- Specified by:
isSupportsCMYKColorsin interfacePdfBoxOutputDevice
-
drawWithGraphics
public void drawWithGraphics(float x, float y, float width, float height, OutputDeviceGraphicsDrawer renderer)Description copied from interface:OutputDeviceDraw something using a Graphics2D at the given rectangle.- Specified by:
drawWithGraphicsin interfaceOutputDevice- Specified by:
drawWithGraphicsin interfacePdfBoxOutputDevice
-
findPagePositionsByID
public java.util.List<PagePosition<Box>> findPagePositionsByID(CssContext c, java.util.regex.Pattern pattern)
- Specified by:
findPagePositionsByIDin interfacePdfBoxOutputDevice
-
calcPDFPagePosition
private PagePosition<Box> calcPDFPagePosition(CssContext c, java.lang.String id, Box box)
-
setRenderingContext
public void setRenderingContext(RenderingContext result)
- Specified by:
setRenderingContextin interfacePdfBoxOutputDevice
-
setBidiReorderer
public void setBidiReorderer(BidiReorderer reorderer)
- Specified by:
setBidiReordererin interfacePdfBoxOutputDevice
-
popTransforms
public void popTransforms(java.util.List<java.awt.geom.AffineTransform> inverse)
- Specified by:
popTransformsin interfaceOutputDevice- Specified by:
popTransformsin interfacePdfBoxOutputDevice
-
pushTransforms
public java.util.List<java.awt.geom.AffineTransform> pushTransforms(java.util.List<java.awt.geom.AffineTransform> transforms)
Description copied from interface:OutputDeviceApply the given transform on top of the current one in the PDF graphics stream. This is a cumulative operation. You should popTransform after the box and children are painted.- Specified by:
pushTransformsin interfaceOutputDevice- Specified by:
pushTransformsin interfacePdfBoxOutputDevice- Returns:
- the list of inverse transforms to undo the effect of this transform
-
reapplyTransforms
private void reapplyTransforms()
-
getAbsoluteTransformOriginX
public float getAbsoluteTransformOriginX()
- Specified by:
getAbsoluteTransformOriginXin interfaceOutputDevice- Specified by:
getAbsoluteTransformOriginXin interfacePdfBoxOutputDevice
-
getAbsoluteTransformOriginY
public float getAbsoluteTransformOriginY()
- Specified by:
getAbsoluteTransformOriginYin interfaceOutputDevice- Specified by:
getAbsoluteTransformOriginYin interfacePdfBoxOutputDevice
-
setPaint
public void setPaint(java.awt.Paint paint)
- Specified by:
setPaintin interfaceOutputDevice- Specified by:
setPaintin interfacePdfBoxOutputDevice
-
isPDF
public boolean isPDF()
- Specified by:
isPDFin interfaceOutputDevice- Specified by:
isPDFin interfacePdfBoxOutputDevice- Overrides:
isPDFin classAbstractOutputDevice
-
close
public void close()
Perform any internal cleanup needed- Specified by:
closein interfacePdfBoxOutputDevice
-
normalizeTransform
private java.awt.geom.AffineTransform normalizeTransform(java.awt.geom.AffineTransform transform)
-
pushTransformLayer
public void pushTransformLayer(java.awt.geom.AffineTransform transform)
Description copied from interface:OutputDeviceApplies a transform on the output device. This is a cumulativew operation. NOTE: The current implementation shares a stack between transforms and clips, so calls toOutputDevice.pushTransformLayer(AffineTransform),OutputDevice.popTransformLayer(),OutputDevice.pushClip(Shape)andOutputDevice.popClip()MUST be nested correctly.- Specified by:
pushTransformLayerin interfaceOutputDevice- Specified by:
pushTransformLayerin interfacePdfBoxOutputDevice
-
popTransformLayer
public void popTransformLayer()
Description copied from interface:OutputDeviceReverts the transform on the stack. NOTE: The current implementation shares a stack between transforms and clips, so calls toOutputDevice.pushTransformLayer(AffineTransform),OutputDevice.popTransformLayer(),OutputDevice.pushClip(Shape)andOutputDevice.popClip()MUST be nested correctly.- Specified by:
popTransformLayerin interfaceOutputDevice- Specified by:
popTransformLayerin interfacePdfBoxOutputDevice
-
isFastRenderer
public boolean isFastRenderer()
Description copied from interface:OutputDeviceThe new (2018) fast renderer is in use.- Specified by:
isFastRendererin interfaceOutputDevice- Specified by:
isFastRendererin interfacePdfBoxOutputDevice
-
clearPageState
private void clearPageState()
-
startStructure
public java.lang.Object startStructure(StructureType type, Box box)
Description copied from interface:OutputDevicePropagate the structure heirachy to allow for PDF/UA compliance.- Specified by:
startStructurein interfaceOutputDevice
-
endStructure
public void endStructure(java.lang.Object token)
- Specified by:
endStructurein interfaceOutputDevice
-
-