java.lang.Object
org.xhtmlrenderer.render.AbstractOutputDevice
org.xhtmlrenderer.pdf.ITextOutputDevice
- All Implemented Interfaces:
org.xhtmlrenderer.extend.OutputDevice
public class ITextOutputDevice
extends org.xhtmlrenderer.render.AbstractOutputDevice
implements org.xhtmlrenderer.extend.OutputDevice
This class is largely based on
PdfGraphics2D.
See http://sourceforge.net/
projects/itext/ for license information.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadata(String name, String value) Appends a name/content metadata pair to this output device.voidcom.lowagie.text.RectanglecreateLocalTargetArea(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) com.lowagie.text.RectanglecreateTargetArea(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) voidvoiddrawBorderLine(Shape bounds, int side, int lineWidth, boolean solid) voiddrawImage(org.xhtmlrenderer.extend.FSImage fsImage, int x, int y) protected voiddrawLine(int x1, int y1, int x2, int y2) voiddrawOval(int x, int y, int width, int height) voiddrawRect(int x, int y, int width, int height) voiddrawSelection(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.InlineText inlineText) voiddrawString(String s, float x, float y, org.xhtmlrenderer.render.JustificationInfo info) voidvoidfillOval(int x, int y, int width, int height) voidfillRect(int x, int y, int width, int height) findPagePositionsByID(org.xhtmlrenderer.css.style.CssContext c, Pattern pattern) voidfinish(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box root) voidgetClip()com.lowagie.text.pdf.PdfContentBytefloatgetDeviceLength(float length) floatgetMetadataByName(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.intcom.lowagie.text.pdf.PdfReaderorg.xhtmlrenderer.layout.SharedContextintcom.lowagie.text.pdf.PdfWritervoidinitializePage(com.lowagie.text.pdf.PdfContentByte currentPage, float height) booleanbooleanvoidpaintBackground(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) voidpaintReplacedElement(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.BlockBox box) voidvoidsetColor(org.xhtmlrenderer.css.parser.FSColor color) voidsetFont(org.xhtmlrenderer.render.FSFont font) voidsetMetadata(String name, String value) Replaces all copies of the named metadata with a single value.voidsetRenderingHint(RenderingHints.Key key, Object value) voidsetRoot(org.xhtmlrenderer.render.Box root) voidsetSharedContext(org.xhtmlrenderer.layout.SharedContext sharedContext) voidsetStartPageNo(int startPageNo) voidvoidsetWriter(com.lowagie.text.pdf.PdfWriter writer) voidvoidtranslate(double tx, double ty) Methods inherited from class org.xhtmlrenderer.render.AbstractOutputDevice
drawDebugOutline, drawText, drawTextDecoration, drawTextDecoration, getFontSpecification, paintBackground, paintBorder, paintBorder, paintCollapsedBorder, setFontSpecificationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
public void paintReplacedElement(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.BlockBox box) - Specified by:
paintReplacedElementin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
paintBackground
public void paintBackground(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) - Specified by:
paintBackgroundin interfaceorg.xhtmlrenderer.extend.OutputDevice- Overrides:
paintBackgroundin classorg.xhtmlrenderer.render.AbstractOutputDevice
-
createLocalTargetArea
public com.lowagie.text.Rectangle createLocalTargetArea(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) -
createTargetArea
public com.lowagie.text.Rectangle createTargetArea(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) -
getDeviceLength
public float getDeviceLength(float length) -
drawBorderLine
- Specified by:
drawBorderLinein interfaceorg.xhtmlrenderer.extend.OutputDevice
-
setColor
public void setColor(org.xhtmlrenderer.css.parser.FSColor color) - Specified by:
setColorin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
draw
- Specified by:
drawin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
drawLine
protected void drawLine(int x1, int y1, int x2, int y2) - Specified by:
drawLinein classorg.xhtmlrenderer.render.AbstractOutputDevice
-
drawRect
public void drawRect(int x, int y, int width, int height) - Specified by:
drawRectin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
drawOval
public void drawOval(int x, int y, int width, int height) - Specified by:
drawOvalin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
fill
- Specified by:
fillin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
fillRect
public void fillRect(int x, int y, int width, int height) - Specified by:
fillRectin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
fillOval
public void fillOval(int x, int y, int width, int height) - Specified by:
fillOvalin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
translate
public void translate(double tx, double ty) - Specified by:
translatein interfaceorg.xhtmlrenderer.extend.OutputDevice
-
getRenderingHint
- Specified by:
getRenderingHintin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
setRenderingHint
- Specified by:
setRenderingHintin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
setFont
public void setFont(org.xhtmlrenderer.render.FSFont font) - Specified by:
setFontin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
drawString
-
getTransform
-
getCurrentPage
public com.lowagie.text.pdf.PdfContentByte getCurrentPage() -
setStroke
- Specified by:
setStrokein interfaceorg.xhtmlrenderer.extend.OutputDevice
-
clip
- Specified by:
clipin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
getClip
- Specified by:
getClipin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
setClip
- Specified by:
setClipin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
getStroke
- Specified by:
getStrokein interfaceorg.xhtmlrenderer.extend.OutputDevice
-
drawImage
public void drawImage(org.xhtmlrenderer.extend.FSImage fsImage, int x, int y) - Specified by:
drawImagein interfaceorg.xhtmlrenderer.extend.OutputDevice
-
getReader
- Throws:
IOException
-
getDotsPerPoint
public float getDotsPerPoint() -
start
-
finish
public void finish(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.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 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
public void setRoot(org.xhtmlrenderer.render.Box root) -
getStartPageNo
public int getStartPageNo() -
setStartPageNo
public void setStartPageNo(int startPageNo) -
drawSelection
public void drawSelection(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.InlineText inlineText) - Specified by:
drawSelectionin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
isSupportsSelection
public boolean isSupportsSelection()- Specified by:
isSupportsSelectionin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
isSupportsCMYKColors
public boolean isSupportsCMYKColors()- Specified by:
isSupportsCMYKColorsin interfaceorg.xhtmlrenderer.extend.OutputDevice
-
findPagePositionsByID
public List<PagePosition> findPagePositionsByID(org.xhtmlrenderer.css.style.CssContext c, Pattern pattern)
-