Package com.openhtmltopdf.pdfboxout
Interface PdfBoxOutputDevice
- All Superinterfaces:
com.openhtmltopdf.extend.OutputDevice
- All Known Implementing Classes:
PdfBoxFastOutputDevice,PdfBoxSlowOutputDevice
public interface PdfBoxOutputDevice
extends com.openhtmltopdf.extend.OutputDevice
-
Method Summary
Modifier and Type Method Description voidaddMetadata(String name, String value)Appends a name/content metadata pair to this output device.voidclip(Shape s)voidclose()Perform any internal cleanup neededvoiddraw(Shape s)voiddrawBorderLine(Shape bounds, int side, int lineWidth, boolean solid)voiddrawImage(com.openhtmltopdf.extend.FSImage fsImage, int x, int y, boolean interpolate)voiddrawOval(int x, int y, int width, int height)voiddrawPdfAsImage(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject _src, Rectangle contentBounds, float intrinsicWidth, float intrinsicHeight)voiddrawRect(int x, int y, int width, int height)voiddrawSelection(com.openhtmltopdf.render.RenderingContext c, com.openhtmltopdf.render.InlineText inlineText)voiddrawString(String s, float x, float y, com.openhtmltopdf.render.JustificationInfo info)voiddrawStringFast(String s, float x, float y, com.openhtmltopdf.render.JustificationInfo info, PdfBoxFontResolver.FontDescription desc, float fontSize)voiddrawWithGraphics(float x, float y, float width, float height, com.openhtmltopdf.extend.OutputDeviceGraphicsDrawer renderer)voidfill(Shape s)voidfillOval(int x, int y, int width, int height)voidfillRect(int x, int y, int width, int height)List<PagePosition>findPagePositionsByID(com.openhtmltopdf.css.style.CssContext c, Pattern pattern)voidfinish(com.openhtmltopdf.render.RenderingContext c, com.openhtmltopdf.render.Box root)voidfinishPage()floatgetAbsoluteTransformOriginX()floatgetAbsoluteTransformOriginY()ShapegetClip()PdfContentStreamAdaptergetCurrentPage()floatgetDeviceLength(float length)Given a value in dots units, converts to PDF points.floatgetDotsPerPoint()List<com.openhtmltopdf.pdfboxout.PdfBoxSlowOutputDevice.Metadata>getMetadata()StringgetMetadataByName(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.List<String>getMetadataListByName(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(com.openhtmltopdf.render.Box box)ObjectgetRenderingHint(RenderingHints.Key key)com.openhtmltopdf.layout.SharedContextgetSharedContext()intgetStartPageNo()StrokegetStroke()org.apache.pdfbox.pdmodel.PDDocumentgetWriter()voidinitializePage(org.apache.pdfbox.pdmodel.PDPageContentStream currentPage, org.apache.pdfbox.pdmodel.PDPage page, float height)Start a page.booleanisFastRenderer()booleanisPDF()booleanisSupportsCMYKColors()booleanisSupportsSelection()floatnormalizeY(float y, float pageHeight)Converts a top down unit to a bottom up PDF unit for the specified page height.voidpaintBackground(com.openhtmltopdf.render.RenderingContext c, com.openhtmltopdf.render.Box box)We use paintBackground to do extra stuff such as processing links, forms and form controls.voidpaintReplacedElement(com.openhtmltopdf.render.RenderingContext c, com.openhtmltopdf.render.BlockBox box)voidpopClip()voidpopTransformLayer()voidpopTransforms(List<AffineTransform> inverse)voidpushClip(Shape s)voidpushTransformLayer(AffineTransform transform)List<AffineTransform>pushTransforms(List<AffineTransform> transforms)voidrealizeImage(PdfBoxImage img)voidsetBidiReorderer(com.openhtmltopdf.bidi.BidiReorderer reorderer)voidsetClip(Shape s)voidsetColor(com.openhtmltopdf.css.parser.FSColor color)voidsetFont(com.openhtmltopdf.render.FSFont font)voidsetMetadata(String name, String value)Replaces all copies of the named metadata with a single value.voidsetPaint(Paint paint)voidsetRenderingContext(com.openhtmltopdf.render.RenderingContext result)voidsetRenderingHint(RenderingHints.Key key, Object value)voidsetRoot(com.openhtmltopdf.render.Box root)voidsetSharedContext(com.openhtmltopdf.layout.SharedContext sharedContext)voidsetStartPageNo(int startPageNo)voidsetStroke(Stroke s)voidsetWriter(org.apache.pdfbox.pdmodel.PDDocument writer)voidstart(Document doc)voidtranslate(double tx, double ty)Methods inherited from interface com.openhtmltopdf.extend.OutputDevice
drawDebugOutline, drawLinearGradient, drawText, drawTextDecoration, drawTextDecoration, endStructure, paintBackground, paintBorder, paintBorder, paintCollapsedBorder, startStructure
-
Method Details
-
setWriter
void setWriter(org.apache.pdfbox.pdmodel.PDDocument writer) -
getWriter
org.apache.pdfbox.pdmodel.PDDocument getWriter() -
initializePage
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. -
finishPage
void finishPage() -
paintReplacedElement
void paintReplacedElement(com.openhtmltopdf.render.RenderingContext c, com.openhtmltopdf.render.BlockBox box)- Specified by:
paintReplacedElementin interfacecom.openhtmltopdf.extend.OutputDevice
-
paintBackground
void paintBackground(com.openhtmltopdf.render.RenderingContext c, com.openhtmltopdf.render.Box box)We use paintBackground to do extra stuff such as processing links, forms and form controls.- Specified by:
paintBackgroundin interfacecom.openhtmltopdf.extend.OutputDevice
-
getDeviceLength
float getDeviceLength(float length)Given a value in dots units, converts to PDF points. -
drawBorderLine
- Specified by:
drawBorderLinein interfacecom.openhtmltopdf.extend.OutputDevice
-
setColor
void setColor(com.openhtmltopdf.css.parser.FSColor color)- Specified by:
setColorin interfacecom.openhtmltopdf.extend.OutputDevice
-
draw
- Specified by:
drawin interfacecom.openhtmltopdf.extend.OutputDevice
-
drawRect
void drawRect(int x, int y, int width, int height)- Specified by:
drawRectin interfacecom.openhtmltopdf.extend.OutputDevice
-
drawOval
void drawOval(int x, int y, int width, int height)- Specified by:
drawOvalin interfacecom.openhtmltopdf.extend.OutputDevice
-
fill
- Specified by:
fillin interfacecom.openhtmltopdf.extend.OutputDevice
-
fillRect
void fillRect(int x, int y, int width, int height)- Specified by:
fillRectin interfacecom.openhtmltopdf.extend.OutputDevice
-
fillOval
void fillOval(int x, int y, int width, int height)- Specified by:
fillOvalin interfacecom.openhtmltopdf.extend.OutputDevice
-
translate
void translate(double tx, double ty)- Specified by:
translatein interfacecom.openhtmltopdf.extend.OutputDevice
-
getRenderingHint
- Specified by:
getRenderingHintin interfacecom.openhtmltopdf.extend.OutputDevice
-
setRenderingHint
- Specified by:
setRenderingHintin interfacecom.openhtmltopdf.extend.OutputDevice
-
setFont
void setFont(com.openhtmltopdf.render.FSFont font)- Specified by:
setFontin interfacecom.openhtmltopdf.extend.OutputDevice
-
drawString
-
drawStringFast
void drawStringFast(String s, float x, float y, com.openhtmltopdf.render.JustificationInfo info, PdfBoxFontResolver.FontDescription desc, float fontSize) -
getCurrentPage
PdfContentStreamAdapter getCurrentPage() -
getPage
org.apache.pdfbox.pdmodel.PDPage getPage() -
normalizeY
float normalizeY(float y, float pageHeight)Converts a top down unit to a bottom up PDF unit for the specified page height. -
setStroke
- Specified by:
setStrokein interfacecom.openhtmltopdf.extend.OutputDevice
-
clip
- Specified by:
clipin interfacecom.openhtmltopdf.extend.OutputDevice
-
getClip
Shape getClip()- Specified by:
getClipin interfacecom.openhtmltopdf.extend.OutputDevice
-
popClip
void popClip()- Specified by:
popClipin interfacecom.openhtmltopdf.extend.OutputDevice
-
pushClip
- Specified by:
pushClipin interfacecom.openhtmltopdf.extend.OutputDevice
-
setClip
- Specified by:
setClipin interfacecom.openhtmltopdf.extend.OutputDevice
-
getStroke
Stroke getStroke()- Specified by:
getStrokein interfacecom.openhtmltopdf.extend.OutputDevice
-
realizeImage
-
drawImage
void drawImage(com.openhtmltopdf.extend.FSImage fsImage, int x, int y, boolean interpolate)- Specified by:
drawImagein interfacecom.openhtmltopdf.extend.OutputDevice
-
getDotsPerPoint
float getDotsPerPoint() -
start
-
finish
void finish(com.openhtmltopdf.render.RenderingContext c, com.openhtmltopdf.render.Box root) -
addMetadata
Appends a name/content metadata pair to this output device. A name or content value of null will be ignored.- Parameters:
name- the name of the metadata element to add.
-
getMetadataByName
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.- Parameters:
name- the metadata element name to locate.- Returns:
- the content value of the first found metadata element; otherwise null.
-
getMetadataListByName
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.- Parameters:
name- the metadata element name to locate.- Returns:
- an ArrayList with matching content values; otherwise an empty list.
-
setMetadata
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.- Parameters:
name- the metadata element name to locate.
-
setRoot
void setRoot(com.openhtmltopdf.render.Box root) -
getStartPageNo
int getStartPageNo() -
setStartPageNo
void setStartPageNo(int startPageNo) -
drawSelection
void drawSelection(com.openhtmltopdf.render.RenderingContext c, com.openhtmltopdf.render.InlineText inlineText)- Specified by:
drawSelectionin interfacecom.openhtmltopdf.extend.OutputDevice
-
isSupportsSelection
boolean isSupportsSelection()- Specified by:
isSupportsSelectionin interfacecom.openhtmltopdf.extend.OutputDevice
-
isSupportsCMYKColors
boolean isSupportsCMYKColors()- Specified by:
isSupportsCMYKColorsin interfacecom.openhtmltopdf.extend.OutputDevice
-
drawWithGraphics
void drawWithGraphics(float x, float y, float width, float height, com.openhtmltopdf.extend.OutputDeviceGraphicsDrawer renderer)- Specified by:
drawWithGraphicsin interfacecom.openhtmltopdf.extend.OutputDevice
-
findPagePositionsByID
List<PagePosition> findPagePositionsByID(com.openhtmltopdf.css.style.CssContext c, Pattern pattern) -
setRenderingContext
void setRenderingContext(com.openhtmltopdf.render.RenderingContext result) -
setBidiReorderer
void setBidiReorderer(com.openhtmltopdf.bidi.BidiReorderer reorderer) -
popTransforms
- Specified by:
popTransformsin interfacecom.openhtmltopdf.extend.OutputDevice
-
pushTransforms
- Specified by:
pushTransformsin interfacecom.openhtmltopdf.extend.OutputDevice
-
getAbsoluteTransformOriginX
float getAbsoluteTransformOriginX()- Specified by:
getAbsoluteTransformOriginXin interfacecom.openhtmltopdf.extend.OutputDevice
-
getAbsoluteTransformOriginY
float getAbsoluteTransformOriginY()- Specified by:
getAbsoluteTransformOriginYin interfacecom.openhtmltopdf.extend.OutputDevice
-
setPaint
- Specified by:
setPaintin interfacecom.openhtmltopdf.extend.OutputDevice
-
isPDF
boolean isPDF()- Specified by:
isPDFin interfacecom.openhtmltopdf.extend.OutputDevice
-
close
void close()Perform any internal cleanup needed -
pushTransformLayer
- Specified by:
pushTransformLayerin interfacecom.openhtmltopdf.extend.OutputDevice
-
popTransformLayer
void popTransformLayer()- Specified by:
popTransformLayerin interfacecom.openhtmltopdf.extend.OutputDevice
-
isFastRenderer
boolean isFastRenderer()- Specified by:
isFastRendererin interfacecom.openhtmltopdf.extend.OutputDevice
-
getPageRefY
int getPageRefY(com.openhtmltopdf.render.Box box) -
getMetadata
List<com.openhtmltopdf.pdfboxout.PdfBoxSlowOutputDevice.Metadata> getMetadata() -
drawPdfAsImage
void drawPdfAsImage(org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject _src, Rectangle contentBounds, float intrinsicWidth, float intrinsicHeight)
-