public class PdfBoxOutputDevice extends AbstractOutputDevice implements OutputDevice
| Modifier and Type | Class and Description |
|---|---|
static class |
PdfBoxOutputDevice.FontRun |
| Constructor and Description |
|---|
PdfBoxOutputDevice(float dotsPerPoint,
boolean testMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMetadata(String name,
String value)
Appends a name/content metadata pair to this output device.
|
void |
clip(Shape s) |
void |
close()
Perform any internal cleanup needed
|
void |
draw(Shape s) |
void |
drawBorderLine(Shape bounds,
int side,
int lineWidth,
boolean solid) |
void |
drawImage(FSImage fsImage,
int x,
int y) |
protected void |
drawLine(int x1,
int y1,
int x2,
int y2) |
void |
drawOval(int x,
int y,
int width,
int height) |
void |
drawRect(int x,
int y,
int width,
int height) |
void |
drawSelection(RenderingContext c,
InlineText inlineText) |
void |
drawString(String s,
float x,
float y,
JustificationInfo info) |
void |
drawStringFast(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) |
void |
fill(Shape s) |
void |
fillOval(int x,
int y,
int width,
int height) |
void |
fillRect(int x,
int y,
int width,
int height) |
List |
findPagePositionsByID(CssContext c,
Pattern pattern) |
void |
finish(RenderingContext c,
Box root) |
void |
finishPage() |
float |
getAbsoluteTransformOriginX() |
float |
getAbsoluteTransformOriginY() |
Shape |
getClip() |
PdfContentStreamAdapter |
getCurrentPage() |
float |
getDeviceLength(float length)
Given a value in dots units, converts to PDF points.
|
float |
getDotsPerPoint() |
String |
getMetadataByName(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 |
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.PDPage |
getPage() |
Object |
getRenderingHint(RenderingHints.Key key) |
SharedContext |
getSharedContext() |
int |
getStartPageNo() |
Stroke |
getStroke() |
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 |
isPDF() |
boolean |
isSupportsCMYKColors() |
boolean |
isSupportsSelection() |
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 |
popTransforms(List<AffineTransform> inverse) |
List<AffineTransform> |
pushTransforms(List<AffineTransform> transforms) |
void |
realizeImage(PdfBoxImage img) |
void |
setBidiReorderer(BidiReorderer reorderer) |
void |
setClip(Shape s) |
void |
setColor(FSColor color) |
void |
setFont(FSFont font) |
void |
setMetadata(String name,
String value)
Replaces all copies of the named metadata with a single value.
|
void |
setPaint(Paint paint) |
void |
setRenderingContext(RenderingContext result) |
void |
setRenderingHint(RenderingHints.Key key,
Object value) |
void |
setRoot(Box root) |
void |
setSharedContext(SharedContext sharedContext) |
void |
setStartPageNo(int startPageNo) |
void |
setStroke(Stroke s) |
void |
setWriter(org.apache.pdfbox.pdmodel.PDDocument writer) |
void |
start(Document doc) |
void |
translate(double tx,
double ty) |
drawDebugOutline, drawText, drawTextDecoration, drawTextDecoration, getFontSpecification, paintBackground, paintBorder, paintBorder, paintCollapsedBorder, setFontSpecificationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdrawDebugOutline, drawText, drawTextDecoration, drawTextDecoration, paintBackground, paintBorder, paintBorder, paintCollapsedBorderpublic PdfBoxOutputDevice(float dotsPerPoint,
boolean testMode)
public void setWriter(org.apache.pdfbox.pdmodel.PDDocument writer)
public org.apache.pdfbox.pdmodel.PDDocument getWriter()
public void initializePage(org.apache.pdfbox.pdmodel.PDPageContentStream currentPage,
org.apache.pdfbox.pdmodel.PDPage page,
float height)
public void finishPage()
public void paintReplacedElement(RenderingContext c, BlockBox box)
paintReplacedElement in interface OutputDevicepublic void paintBackground(RenderingContext c, Box box)
paintBackground in interface OutputDevicepaintBackground in class AbstractOutputDevicepublic float getDeviceLength(float length)
public void drawBorderLine(Shape bounds, int side, int lineWidth, boolean solid)
drawBorderLine in interface OutputDevicepublic void setColor(FSColor color)
setColor in interface OutputDevicepublic void draw(Shape s)
draw in interface OutputDeviceprotected void drawLine(int x1,
int y1,
int x2,
int y2)
drawLine in class AbstractOutputDevicepublic void drawRect(int x,
int y,
int width,
int height)
drawRect in interface OutputDevicepublic void drawOval(int x,
int y,
int width,
int height)
drawOval in interface OutputDevicepublic void fill(Shape s)
fill in interface OutputDevicepublic void fillRect(int x,
int y,
int width,
int height)
fillRect in interface OutputDevicepublic void fillOval(int x,
int y,
int width,
int height)
fillOval in interface OutputDevicepublic void translate(double tx,
double ty)
translate in interface OutputDevicepublic Object getRenderingHint(RenderingHints.Key key)
getRenderingHint in interface OutputDevicepublic void setRenderingHint(RenderingHints.Key key, Object value)
setRenderingHint in interface OutputDevicepublic void setFont(FSFont font)
setFont in interface OutputDevicepublic void drawString(String s, float x, float y, JustificationInfo info)
public void drawStringFast(String s, float x, float y, JustificationInfo info, PdfBoxFontResolver.FontDescription desc, float fontSize)
public PdfContentStreamAdapter getCurrentPage()
public org.apache.pdfbox.pdmodel.PDPage getPage()
public void setStroke(Stroke s)
setStroke in interface OutputDevicepublic void clip(Shape s)
clip in interface OutputDevicepublic Shape getClip()
getClip in interface OutputDevicepublic void setClip(Shape s)
setClip in interface OutputDevicepublic Stroke getStroke()
getStroke in interface OutputDevicepublic void realizeImage(PdfBoxImage img)
public void drawImage(FSImage fsImage, int x, int y)
drawImage in interface OutputDevicepublic float getDotsPerPoint()
public void start(Document doc)
public void finish(RenderingContext c, Box root)
public void addMetadata(String name, String value)
name - the name of the metadata element to add.public String getMetadataByName(String name)
name - the metadata element name to locate.public List getMetadataListByName(String name)
name - the metadata element name to locate.public void setMetadata(String name, String value)
addMetadata to append additional values with
the same name.name - the metadata element name to locate.public SharedContext getSharedContext()
public void setSharedContext(SharedContext sharedContext)
public void setRoot(Box root)
public int getStartPageNo()
public void setStartPageNo(int startPageNo)
public void drawSelection(RenderingContext c, InlineText inlineText)
drawSelection in interface OutputDevicepublic boolean isSupportsSelection()
isSupportsSelection in interface OutputDevicepublic boolean isSupportsCMYKColors()
isSupportsCMYKColors in interface OutputDevicepublic void drawWithGraphics(float x,
float y,
float width,
float height,
OutputDeviceGraphicsDrawer renderer)
drawWithGraphics in interface OutputDevicepublic List findPagePositionsByID(CssContext c, Pattern pattern)
public void setRenderingContext(RenderingContext result)
public void setBidiReorderer(BidiReorderer reorderer)
public void popTransforms(List<AffineTransform> inverse)
popTransforms in interface OutputDevicepublic List<AffineTransform> pushTransforms(List<AffineTransform> transforms)
pushTransforms in interface OutputDevicepublic float getAbsoluteTransformOriginX()
getAbsoluteTransformOriginX in interface OutputDevicepublic float getAbsoluteTransformOriginY()
getAbsoluteTransformOriginY in interface OutputDevicepublic void setPaint(Paint paint)
setPaint in interface OutputDevicepublic boolean isPDF()
isPDF in interface OutputDeviceisPDF in class AbstractOutputDevicepublic void close()
Copyright © 2018. All rights reserved.