Package org.xhtmlrenderer.pdf
Class ITextOutputDevice
java.lang.Object
org.xhtmlrenderer.render.AbstractOutputDevice
org.xhtmlrenderer.pdf.ITextOutputDevice
- All Implemented Interfaces:
OutputDevice
This class is largely based on
PdfGraphics2D
.
See http://sourceforge.net/
projects/itext/ for license information.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMetadata
(String name, String value) Appends a name/content metadata pair to this output device.void
com.lowagie.text.Rectangle
createLocalTargetArea
(RenderingContext c, Box box) com.lowagie.text.Rectangle
createTargetArea
(RenderingContext c, Box box) void
void
drawBorderLine
(Shape bounds, int side, int lineWidth, boolean solid) void
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
void
fillOval
(int x, int y, int width, int height) void
fillRect
(int x, int y, int width, int height) findPagePositionsByID
(CssContext c, Pattern pattern) void
finish
(RenderingContext c, Box root) void
getClip()
com.lowagie.text.pdf.PdfContentByte
float
getDeviceLength
(float length) float
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.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.int
com.lowagie.text.pdf.PdfReader
int
com.lowagie.text.pdf.PdfWriter
void
initializePage
(com.lowagie.text.pdf.PdfContentByte currentPage, float height) boolean
boolean
void
paintBackground
(RenderingContext c, Box box) void
void
void
void
void
setMetadata
(String name, String value) Replaces all copies of the named metadata with a single value.void
setRenderingHint
(RenderingHints.Key key, Object value) void
void
setSharedContext
(SharedContext sharedContext) void
setStartPageNo
(int startPageNo) void
void
setWriter
(com.lowagie.text.pdf.PdfWriter writer) void
void
translate
(double tx, double ty) Methods inherited from class org.xhtmlrenderer.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 org.xhtmlrenderer.extend.OutputDevice
drawDebugOutline, drawText, drawTextDecoration, drawTextDecoration, paintBackground, paintBorder, paintBorder, paintCollapsedBorder
-
Constructor Details
-
ITextOutputDevice
public ITextOutputDevice(float dotsPerPoint)
-
-
Method Details
-
setWriter
public void setWriter(com.lowagie.text.pdf.PdfWriter writer) -
getWriter
public com.lowagie.text.pdf.PdfWriter getWriter() -
getNextFormFieldIndex
public int getNextFormFieldIndex() -
initializePage
public void initializePage(com.lowagie.text.pdf.PdfContentByte currentPage, float height) -
finishPage
public void finishPage() -
paintReplacedElement
- Specified by:
paintReplacedElement
in interfaceOutputDevice
-
paintBackground
- Specified by:
paintBackground
in interfaceOutputDevice
- Overrides:
paintBackground
in classAbstractOutputDevice
-
createLocalTargetArea
-
createTargetArea
-
getDeviceLength
public float getDeviceLength(float length) -
drawBorderLine
- Specified by:
drawBorderLine
in interfaceOutputDevice
-
setColor
- Specified by:
setColor
in interfaceOutputDevice
-
draw
- Specified by:
draw
in interfaceOutputDevice
-
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
-
drawOval
public void drawOval(int x, int y, int width, int height) - Specified by:
drawOval
in interfaceOutputDevice
-
fill
- Specified by:
fill
in interfaceOutputDevice
-
fillRect
public void fillRect(int x, int y, int width, int height) - Specified by:
fillRect
in interfaceOutputDevice
-
fillOval
public void fillOval(int x, int y, int width, int height) - Specified by:
fillOval
in interfaceOutputDevice
-
translate
public void translate(double tx, double ty) - Specified by:
translate
in interfaceOutputDevice
-
getRenderingHint
- Specified by:
getRenderingHint
in interfaceOutputDevice
-
setRenderingHint
- Specified by:
setRenderingHint
in interfaceOutputDevice
-
setFont
- Specified by:
setFont
in interfaceOutputDevice
-
drawString
-
getTransform
-
getCurrentPage
public com.lowagie.text.pdf.PdfContentByte getCurrentPage() -
setStroke
- Specified by:
setStroke
in interfaceOutputDevice
-
clip
- Specified by:
clip
in interfaceOutputDevice
-
getClip
- Specified by:
getClip
in interfaceOutputDevice
-
setClip
- Specified by:
setClip
in interfaceOutputDevice
-
getStroke
- Specified by:
getStroke
in interfaceOutputDevice
-
drawImage
- Specified by:
drawImage
in interfaceOutputDevice
-
getReader
- Throws:
IOException
-
getDotsPerPoint
public float getDotsPerPoint() -
start
-
finish
-
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 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.- Parameters:
name
- the metadata element name to locate.
-
setRoot
-
getStartPageNo
public int getStartPageNo() -
setStartPageNo
public void setStartPageNo(int startPageNo) -
drawSelection
- Specified by:
drawSelection
in interfaceOutputDevice
-
isSupportsSelection
public boolean isSupportsSelection()- Specified by:
isSupportsSelection
in interfaceOutputDevice
-
isSupportsCMYKColors
public boolean isSupportsCMYKColors()- Specified by:
isSupportsCMYKColors
in interfaceOutputDevice
-
findPagePositionsByID
-