Package com.openhtmltopdf.pdfboxout
Class PdfBoxFastOutputDevice
- java.lang.Object
-
- com.openhtmltopdf.render.AbstractOutputDevice
-
- com.openhtmltopdf.pdfboxout.PdfBoxFastOutputDevice
-
- All Implemented Interfaces:
OutputDevice
,PdfBoxOutputDevice
public class PdfBoxFastOutputDevice extends AbstractOutputDevice implements OutputDevice, PdfBoxOutputDevice
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
PdfBoxFastOutputDevice.GraphicsOperation
private static class
PdfBoxFastOutputDevice.PageState
-
Field Summary
Fields Modifier and Type Field Description private PdfBoxBookmarkManager
_bmManager
private java.awt.geom.Area
_clip
private PdfContentStreamAdapter
_cp
private PdfBoxFastOutputDevice.PageState
_desiredPageState
private float
_dotsPerPoint
private PdfBoxFSFont
_font
private de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DFontTextDrawer
_fontTextDrawer
private PdfBoxPerDocumentFormState
_formState
private PdfBoxFastLinkManager
_linkManager
private java.util.List<PdfBoxSlowOutputDevice.Metadata>
_metadata
private java.awt.Stroke
_oldStroke
private java.awt.Stroke
_originalStroke
private org.apache.pdfbox.pdmodel.PDPage
_page
private float
_pageHeight
private java.util.Deque<PdfBoxFastOutputDevice.PageState>
_pageStateStack
private boolean
_pdfAConform
private PdfBoxAccessibilityHelper
_pdfUa
private boolean
_pdfUaConform
private RenderingContext
_renderingContext
private BidiReorderer
_reorderer
private Box
_root
private SharedContext
_sharedContext
private int
_startPageNo
private java.awt.Stroke
_stroke
private boolean
_testMode
private java.awt.geom.AffineTransform
_transform
private org.apache.pdfbox.pdmodel.PDDocument
_writer
private static java.awt.geom.AffineTransform
IDENTITY
private static boolean
ROUND_RECT_DIMENSIONS_DOWN
private static java.awt.BasicStroke
STROKE_ONE
-
Constructor Summary
Constructors Constructor Description PdfBoxFastOutputDevice(float dotsPerPoint, boolean testMode, boolean pdfUaConform, boolean pdfAConform)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMetadata(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 void
clearPageState()
void
clip(java.awt.Shape s)
void
close()
Perform any internal cleanup neededprivate PdfBoxFastOutputDevice.PageState
currentState()
void
draw(java.awt.Shape s)
void
drawBorderLine(java.awt.Shape bounds, int side, int lineWidth, boolean solid)
void
drawImage(FSImage fsImage, int x, int y, boolean interpolate)
protected void
drawLine(int x1, int y1, int x2, int y2)
void
drawLinearGradient(FSLinearGradient backgroundLinearGradient, java.awt.Shape bounds)
void
drawOval(int x, int y, int width, int height)
void
drawPdfAsImage(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject _srcObject, java.awt.Rectangle contentBounds, float intrinsicWidth, float intrinsicHeight)
void
drawRect(int x, int y, int width, int height)
void
drawSelection(RenderingContext c, InlineText inlineText)
void
drawString(java.lang.String s, float x, float y, JustificationInfo info)
void
drawStringFast(java.lang.String s, float x, float y, JustificationInfo info, PdfBoxFontResolver.FontDescription desc, float fontSize)
void
drawWithGraphics(float x, float y, float width, float height, OutputDeviceGraphicsDrawer renderer)
Draw something using a Graphics2D at the given rectangle.void
endStructure(java.lang.Object token)
private void
ensureFillColor()
private void
ensureStrokeColor()
void
fill(java.awt.Shape s)
void
fillOval(int x, int y, int width, int height)
void
fillRect(int x, int y, int width, int height)
java.util.List<PagePosition<Box>>
findPagePositionsByID(CssContext c, java.util.regex.Pattern pattern)
void
finish(RenderingContext c, Box root)
void
finishPage()
private void
followPath(java.awt.Shape s, PdfBoxFastOutputDevice.GraphicsOperation drawType)
float
getAbsoluteTransformOriginX()
float
getAbsoluteTransformOriginY()
java.awt.Shape
getClip()
PdfContentStreamAdapter
getCurrentPage()
float
getDeviceLength(float length)
Given a value in dots units, converts to PDF points.float
getDotsPerPoint()
java.util.List<PdfBoxSlowOutputDevice.Metadata>
getMetadata()
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.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.PDPage
getPage()
int
getPageRefY(Box box)
java.lang.Object
getRenderingHint(java.awt.RenderingHints.Key key)
SharedContext
getSharedContext()
int
getStartPageNo()
java.awt.Stroke
getStroke()
private java.awt.geom.AffineTransform
getTransform()
org.apache.pdfbox.pdmodel.PDDocument
getWriter()
void
initializePage(org.apache.pdfbox.pdmodel.PDPageContentStream currentPage, org.apache.pdfbox.pdmodel.PDPage page, float height)
Start a page.boolean
isFastRenderer()
The new (2018) fast renderer is in use.boolean
isPDF()
boolean
isSupportsCMYKColors()
boolean
isSupportsSelection()
private void
loadMetadata(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.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).private java.awt.geom.AffineTransform
normalizeTransform(java.awt.geom.AffineTransform transform)
float
normalizeY(float y)
Converts a top down unit to a bottom up PDF unit for the current page.private void
normalizeY(float[] coords)
float
normalizeY(float y, float pageHeight)
Converts a top down unit to a bottom up PDF unit for the specified page height.void
paintBackground(RenderingContext c, Box box)
We use paintBackground to do extra stuff such as processing links, forms and form controls.void
paintReplacedElement(RenderingContext c, BlockBox box)
void
popClip()
Reverts the last clip on the stack.private PdfBoxFastOutputDevice.PageState
popState()
void
popTransformLayer()
Reverts the transform on the stack.void
popTransforms(java.util.List<java.awt.geom.AffineTransform> inverse)
private void
processControls()
void
pushClip(java.awt.Shape s)
Applies a clip on the output device.private void
pushState(PdfBoxFastOutputDevice.PageState state)
void
pushTransformLayer(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.void
realizeImage(PdfBoxImage img)
void
setBidiReorderer(BidiReorderer reorderer)
void
setClip(java.awt.Shape s)
void
setColor(FSColor color)
void
setFont(FSFont font)
void
setMetadata(java.lang.String name, java.lang.String value)
Replaces all copies of the named metadata with a single value.void
setPaint(java.awt.Paint paint)
void
setRenderingContext(RenderingContext result)
void
setRenderingHint(java.awt.RenderingHints.Key key, java.lang.Object value)
void
setRoot(Box root)
void
setSharedContext(SharedContext sharedContext)
void
setStartPageNo(int startPageNo)
void
setStroke(java.awt.Stroke s)
private void
setStrokeDiff(java.awt.Stroke newStroke, java.awt.Stroke oldStroke)
void
setWriter(org.apache.pdfbox.pdmodel.PDDocument writer)
void
start(org.w3c.dom.Document doc)
java.lang.Object
startStructure(StructureType type, Box box)
Propagate the structure heirachy to allow for PDF/UA compliance.private java.awt.Stroke
transformStroke(java.awt.Stroke stroke)
void
translate(double tx, double ty)
-
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, drawText, drawTextDecoration, drawTextDecoration, paintBackground, paintBorder, paintBorder, paintCollapsedBorder
-
-
-
-
Field Detail
-
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
- See Also:
- Constant Field Values
-
_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
-
_desiredPageState
private final PdfBoxFastOutputDevice.PageState _desiredPageState
-
_pageStateStack
private final java.util.Deque<PdfBoxFastOutputDevice.PageState> _pageStateStack
-
_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
-
_bmManager
private PdfBoxBookmarkManager _bmManager
-
_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 PdfBoxFastLinkManager _linkManager
-
_renderingContext
private RenderingContext _renderingContext
-
_reorderer
private BidiReorderer _reorderer
-
_fontTextDrawer
private de.rototor.pdfbox.graphics2d.PdfBoxGraphics2DFontTextDrawer _fontTextDrawer
-
_pdfUa
private PdfBoxAccessibilityHelper _pdfUa
-
_pdfUaConform
private final boolean _pdfUaConform
-
_pdfAConform
private final boolean _pdfAConform
-
-
Method Detail
-
setWriter
public void setWriter(org.apache.pdfbox.pdmodel.PDDocument writer)
- Specified by:
setWriter
in interfacePdfBoxOutputDevice
-
getWriter
public org.apache.pdfbox.pdmodel.PDDocument getWriter()
- Specified by:
getWriter
in 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:
initializePage
in interfacePdfBoxOutputDevice
-
currentState
private PdfBoxFastOutputDevice.PageState currentState()
-
pushState
private void pushState(PdfBoxFastOutputDevice.PageState state)
-
popState
private PdfBoxFastOutputDevice.PageState popState()
-
finishPage
public void finishPage()
- Specified by:
finishPage
in interfacePdfBoxOutputDevice
-
paintReplacedElement
public void paintReplacedElement(RenderingContext c, BlockBox box)
- Specified by:
paintReplacedElement
in interfaceOutputDevice
- Specified by:
paintReplacedElement
in 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:
paintBackground
in interfaceOutputDevice
- Specified by:
paintBackground
in interfacePdfBoxOutputDevice
- Overrides:
paintBackground
in classAbstractOutputDevice
-
processControls
private void processControls()
-
getDeviceLength
public float getDeviceLength(float length)
Given a value in dots units, converts to PDF points.- Specified by:
getDeviceLength
in interfacePdfBoxOutputDevice
-
drawBorderLine
public void drawBorderLine(java.awt.Shape bounds, int side, int lineWidth, boolean solid)
- Specified by:
drawBorderLine
in interfaceOutputDevice
- Specified by:
drawBorderLine
in interfacePdfBoxOutputDevice
-
setColor
public void setColor(FSColor color)
- Specified by:
setColor
in interfaceOutputDevice
- Specified by:
setColor
in interfacePdfBoxOutputDevice
-
draw
public void draw(java.awt.Shape s)
- Specified by:
draw
in interfaceOutputDevice
- Specified by:
draw
in interfacePdfBoxOutputDevice
-
drawLine
protected void drawLine(int x1, int y1, int x2, int y2)
- Specified by:
drawLine
in classAbstractOutputDevice
-
drawRect
public void drawRect(int x, int y, int width, int height)
- Specified by:
drawRect
in interfaceOutputDevice
- Specified by:
drawRect
in interfacePdfBoxOutputDevice
-
drawOval
public void drawOval(int x, int y, int width, int height)
- Specified by:
drawOval
in interfaceOutputDevice
- Specified by:
drawOval
in interfacePdfBoxOutputDevice
-
fill
public void fill(java.awt.Shape s)
- Specified by:
fill
in interfaceOutputDevice
- Specified by:
fill
in interfacePdfBoxOutputDevice
-
fillRect
public void fillRect(int x, int y, int width, int height)
- Specified by:
fillRect
in interfaceOutputDevice
- Specified by:
fillRect
in interfacePdfBoxOutputDevice
-
fillOval
public void fillOval(int x, int y, int width, int height)
- Specified by:
fillOval
in interfaceOutputDevice
- Specified by:
fillOval
in interfacePdfBoxOutputDevice
-
translate
public void translate(double tx, double ty)
- Specified by:
translate
in interfaceOutputDevice
- Specified by:
translate
in interfacePdfBoxOutputDevice
-
getRenderingHint
public java.lang.Object getRenderingHint(java.awt.RenderingHints.Key key)
- Specified by:
getRenderingHint
in interfaceOutputDevice
- Specified by:
getRenderingHint
in interfacePdfBoxOutputDevice
-
setRenderingHint
public void setRenderingHint(java.awt.RenderingHints.Key key, java.lang.Object value)
- Specified by:
setRenderingHint
in interfaceOutputDevice
- Specified by:
setRenderingHint
in interfacePdfBoxOutputDevice
-
setFont
public void setFont(FSFont font)
- Specified by:
setFont
in interfaceOutputDevice
- Specified by:
setFont
in 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:
drawString
in interfacePdfBoxOutputDevice
-
drawStringFast
public void drawStringFast(java.lang.String s, float x, float y, JustificationInfo info, PdfBoxFontResolver.FontDescription desc, float fontSize)
- Specified by:
drawStringFast
in 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:
getCurrentPage
in interfacePdfBoxOutputDevice
-
getPage
public org.apache.pdfbox.pdmodel.PDPage getPage()
- Specified by:
getPage
in interfacePdfBoxOutputDevice
-
followPath
private void followPath(java.awt.Shape s, PdfBoxFastOutputDevice.GraphicsOperation drawType)
-
normalizeY
public 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:
normalizeY
in 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:
setStroke
in interfaceOutputDevice
- Specified by:
setStroke
in interfacePdfBoxOutputDevice
-
transformStroke
private java.awt.Stroke transformStroke(java.awt.Stroke stroke)
-
clip
public void clip(java.awt.Shape s)
- Specified by:
clip
in interfaceOutputDevice
- Specified by:
clip
in interfacePdfBoxOutputDevice
-
getClip
public java.awt.Shape getClip()
- Specified by:
getClip
in interfaceOutputDevice
- Specified by:
getClip
in interfacePdfBoxOutputDevice
-
popClip
public void popClip()
Description copied from interface:OutputDevice
Reverts the last clip on the stack. The fast renderer MUST usepushClip
andpopClip
in preference toclip
andsetClip
. 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:
popClip
in interfaceOutputDevice
- Specified by:
popClip
in interfacePdfBoxOutputDevice
-
pushClip
public void pushClip(java.awt.Shape s)
Description copied from interface:OutputDevice
Applies a clip on the output device. This is a cumulative operation. The fast renderer MUST usepushClip
andpopClip
in preference toclip
andsetClip
. 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:
pushClip
in interfaceOutputDevice
- Specified by:
pushClip
in interfacePdfBoxOutputDevice
-
setClip
public void setClip(java.awt.Shape s)
- Specified by:
setClip
in interfaceOutputDevice
- Specified by:
setClip
in interfacePdfBoxOutputDevice
-
getStroke
public java.awt.Stroke getStroke()
- Specified by:
getStroke
in interfaceOutputDevice
- Specified by:
getStroke
in interfacePdfBoxOutputDevice
-
realizeImage
public void realizeImage(PdfBoxImage img)
- Specified by:
realizeImage
in interfacePdfBoxOutputDevice
-
drawLinearGradient
public void drawLinearGradient(FSLinearGradient backgroundLinearGradient, java.awt.Shape bounds)
- Specified by:
drawLinearGradient
in interfaceOutputDevice
-
drawImage
public void drawImage(FSImage fsImage, int x, int y, boolean interpolate)
- Specified by:
drawImage
in interfaceOutputDevice
- Specified by:
drawImage
in interfacePdfBoxOutputDevice
-
drawPdfAsImage
public void drawPdfAsImage(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject _srcObject, java.awt.Rectangle contentBounds, float intrinsicWidth, float intrinsicHeight)
- Specified by:
drawPdfAsImage
in interfacePdfBoxOutputDevice
-
getDotsPerPoint
public float getDotsPerPoint()
- Specified by:
getDotsPerPoint
in interfacePdfBoxOutputDevice
-
start
public void start(org.w3c.dom.Document doc)
- Specified by:
start
in interfacePdfBoxOutputDevice
-
finish
public void finish(RenderingContext c, Box root)
- Specified by:
finish
in interfacePdfBoxOutputDevice
-
getPageRefY
public int getPageRefY(Box box)
- Specified by:
getPageRefY
in interfacePdfBoxOutputDevice
-
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:
addMetadata
in 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:
getMetadataByName
in 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:
getMetadataListByName
in 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. UseaddMetadata
to append additional values with the same name.- Specified by:
setMetadata
in interfacePdfBoxOutputDevice
- Parameters:
name
- the metadata element name to locate.
-
getMetadata
public java.util.List<PdfBoxSlowOutputDevice.Metadata> getMetadata()
- Specified by:
getMetadata
in interfacePdfBoxOutputDevice
- Returns:
- All metadata entries
-
getSharedContext
public SharedContext getSharedContext()
- Specified by:
getSharedContext
in interfacePdfBoxOutputDevice
-
setSharedContext
public void setSharedContext(SharedContext sharedContext)
- Specified by:
setSharedContext
in interfacePdfBoxOutputDevice
-
setRoot
public void setRoot(Box root)
- Specified by:
setRoot
in interfacePdfBoxOutputDevice
-
getStartPageNo
public int getStartPageNo()
- Specified by:
getStartPageNo
in interfacePdfBoxOutputDevice
-
setStartPageNo
public void setStartPageNo(int startPageNo)
- Specified by:
setStartPageNo
in interfacePdfBoxOutputDevice
-
drawSelection
public void drawSelection(RenderingContext c, InlineText inlineText)
- Specified by:
drawSelection
in interfaceOutputDevice
- Specified by:
drawSelection
in interfacePdfBoxOutputDevice
-
isSupportsSelection
public boolean isSupportsSelection()
- Specified by:
isSupportsSelection
in interfaceOutputDevice
- Specified by:
isSupportsSelection
in interfacePdfBoxOutputDevice
-
isSupportsCMYKColors
public boolean isSupportsCMYKColors()
- Specified by:
isSupportsCMYKColors
in interfaceOutputDevice
- Specified by:
isSupportsCMYKColors
in interfacePdfBoxOutputDevice
-
drawWithGraphics
public void drawWithGraphics(float x, float y, float width, float height, OutputDeviceGraphicsDrawer renderer)
Description copied from interface:OutputDevice
Draw something using a Graphics2D at the given rectangle.- Specified by:
drawWithGraphics
in interfaceOutputDevice
- Specified by:
drawWithGraphics
in interfacePdfBoxOutputDevice
-
findPagePositionsByID
public java.util.List<PagePosition<Box>> findPagePositionsByID(CssContext c, java.util.regex.Pattern pattern)
- Specified by:
findPagePositionsByID
in interfacePdfBoxOutputDevice
-
calcPDFPagePosition
private PagePosition<Box> calcPDFPagePosition(CssContext c, java.lang.String id, Box box)
-
setRenderingContext
public void setRenderingContext(RenderingContext result)
- Specified by:
setRenderingContext
in interfacePdfBoxOutputDevice
-
setBidiReorderer
public void setBidiReorderer(BidiReorderer reorderer)
- Specified by:
setBidiReorderer
in interfacePdfBoxOutputDevice
-
popTransforms
public void popTransforms(java.util.List<java.awt.geom.AffineTransform> inverse)
- Specified by:
popTransforms
in interfaceOutputDevice
- Specified by:
popTransforms
in interfacePdfBoxOutputDevice
-
pushTransforms
public java.util.List<java.awt.geom.AffineTransform> pushTransforms(java.util.List<java.awt.geom.AffineTransform> transforms)
Description copied from interface:OutputDevice
Apply 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:
pushTransforms
in interfaceOutputDevice
- Specified by:
pushTransforms
in interfacePdfBoxOutputDevice
- Returns:
- the list of inverse transforms to undo the effect of this transform
-
getAbsoluteTransformOriginX
public float getAbsoluteTransformOriginX()
- Specified by:
getAbsoluteTransformOriginX
in interfaceOutputDevice
- Specified by:
getAbsoluteTransformOriginX
in interfacePdfBoxOutputDevice
-
getAbsoluteTransformOriginY
public float getAbsoluteTransformOriginY()
- Specified by:
getAbsoluteTransformOriginY
in interfaceOutputDevice
- Specified by:
getAbsoluteTransformOriginY
in interfacePdfBoxOutputDevice
-
setPaint
public void setPaint(java.awt.Paint paint)
- Specified by:
setPaint
in interfaceOutputDevice
- Specified by:
setPaint
in interfacePdfBoxOutputDevice
-
isPDF
public boolean isPDF()
- Specified by:
isPDF
in interfaceOutputDevice
- Specified by:
isPDF
in interfacePdfBoxOutputDevice
- Overrides:
isPDF
in classAbstractOutputDevice
-
close
public void close()
Perform any internal cleanup needed- Specified by:
close
in 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:OutputDevice
Applies 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:
pushTransformLayer
in interfaceOutputDevice
- Specified by:
pushTransformLayer
in interfacePdfBoxOutputDevice
-
popTransformLayer
public void popTransformLayer()
Description copied from interface:OutputDevice
Reverts 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:
popTransformLayer
in interfaceOutputDevice
- Specified by:
popTransformLayer
in interfacePdfBoxOutputDevice
-
isFastRenderer
public boolean isFastRenderer()
Description copied from interface:OutputDevice
The new (2018) fast renderer is in use.- Specified by:
isFastRenderer
in interfaceOutputDevice
- Specified by:
isFastRenderer
in interfacePdfBoxOutputDevice
-
clearPageState
private void clearPageState()
-
startStructure
public java.lang.Object startStructure(StructureType type, Box box)
Description copied from interface:OutputDevice
Propagate the structure heirachy to allow for PDF/UA compliance.- Specified by:
startStructure
in interfaceOutputDevice
-
endStructure
public void endStructure(java.lang.Object token)
- Specified by:
endStructure
in interfaceOutputDevice
-
-