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 `com.itextpdf.text.pdf.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.itextpdf.text.RectanglecreateLocalTargetArea(RenderingContext c, Box box) com.itextpdf.text.RectanglecreateTargetArea(RenderingContext c, Box box) voidvoiddrawBorderLine(Shape bounds, int side, int lineWidth, boolean solid) voidprotected 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(RenderingContext c, InlineText inlineText) voiddrawString(String s, float x, float y, JustificationInfo info) voidvoidfillOval(int x, int y, int width, int height) voidfillRect(int x, int y, int width, int height) findPagePositionsByID(CssContext c, Pattern pattern) voidfinish(RenderingContext c, Box root) voidgetClip()com.itextpdf.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.itextpdf.text.pdf.PdfReaderintcom.itextpdf.text.pdf.PdfWritervoidinitializePage(com.itextpdf.text.pdf.PdfContentByte currentPage, float height) booleanbooleanvoidpaintBackground(RenderingContext c, Box box) voidvoidvoidvoidvoidsetMetadata(String name, String value) Replaces all copies of the named metadata with a single value.voidsetRenderingHint(RenderingHints.Key key, Object value) voidvoidsetSharedContext(SharedContext sharedContext) voidsetStartPageNo(int startPageNo) voidvoidsetWriter(com.itextpdf.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.itextpdf.text.pdf.PdfWriter writer) -
getWriter
public com.itextpdf.text.pdf.PdfWriter getWriter() -
getNextFormFieldIndex
public int getNextFormFieldIndex() -
initializePage
public void initializePage(com.itextpdf.text.pdf.PdfContentByte currentPage, float height) -
finishPage
public void finishPage() -
paintReplacedElement
- Specified by:
paintReplacedElementin interfaceOutputDevice
-
paintBackground
- Specified by:
paintBackgroundin interfaceOutputDevice- Overrides:
paintBackgroundin classAbstractOutputDevice
-
createLocalTargetArea
-
createTargetArea
-
getDeviceLength
public float getDeviceLength(float length) -
drawBorderLine
- Specified by:
drawBorderLinein interfaceOutputDevice
-
setColor
- Specified by:
setColorin interfaceOutputDevice
-
draw
- Specified by:
drawin interfaceOutputDevice
-
drawLine
protected void drawLine(int x1, int y1, int x2, int y2) - Specified by:
drawLinein classAbstractOutputDevice
-
drawRect
public void drawRect(int x, int y, int width, int height) - Specified by:
drawRectin interfaceOutputDevice
-
drawOval
public void drawOval(int x, int y, int width, int height) - Specified by:
drawOvalin interfaceOutputDevice
-
fill
- Specified by:
fillin interfaceOutputDevice
-
fillRect
public void fillRect(int x, int y, int width, int height) - Specified by:
fillRectin interfaceOutputDevice
-
fillOval
public void fillOval(int x, int y, int width, int height) - Specified by:
fillOvalin interfaceOutputDevice
-
translate
public void translate(double tx, double ty) - Specified by:
translatein interfaceOutputDevice
-
getRenderingHint
- Specified by:
getRenderingHintin interfaceOutputDevice
-
setRenderingHint
- Specified by:
setRenderingHintin interfaceOutputDevice
-
setFont
- Specified by:
setFontin interfaceOutputDevice
-
drawString
-
getTransform
-
getCurrentPage
public com.itextpdf.text.pdf.PdfContentByte getCurrentPage() -
setStroke
- Specified by:
setStrokein interfaceOutputDevice
-
clip
- Specified by:
clipin interfaceOutputDevice
-
getClip
- Specified by:
getClipin interfaceOutputDevice
-
setClip
- Specified by:
setClipin interfaceOutputDevice
-
getStroke
- Specified by:
getStrokein interfaceOutputDevice
-
drawImage
- Specified by:
drawImagein 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. UseaddMetadatato 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:
drawSelectionin interfaceOutputDevice
-
isSupportsSelection
public boolean isSupportsSelection()- Specified by:
isSupportsSelectionin interfaceOutputDevice
-
isSupportsCMYKColors
public boolean isSupportsCMYKColors()- Specified by:
isSupportsCMYKColorsin interfaceOutputDevice
-
findPagePositionsByID
-