java.lang.Object
org.xhtmlrenderer.render.AbstractOutputDevice<org.xhtmlrenderer.extend.FSImage,ITextFSFont>
org.xhtmlrenderer.pdf.ITextOutputDevice
- All Implemented Interfaces:
org.xhtmlrenderer.extend.OutputDevice<org.xhtmlrenderer.extend.FSImage,ITextFSFont>
public class ITextOutputDevice
extends org.xhtmlrenderer.render.AbstractOutputDevice<org.xhtmlrenderer.extend.FSImage,ITextFSFont>
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.voidorg.openpdf.text.RectanglecreateLocalTargetArea(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) org.openpdf.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) voiddrawLinearGradient(org.xhtmlrenderer.css.style.derived.FSLinearGradient gradient, int x, int y, int width, int height) 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, @Nullable 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) void@Nullable ShapegetClip()org.openpdf.text.pdf.PdfContentBytefloatgetDeviceLength(float length) float@Nullable 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.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.intorg.openpdf.text.pdf.PdfReader@Nullable Objectorg.xhtmlrenderer.layout.SharedContextint@Nullable org.openpdf.text.pdf.PdfWritervoidinitializePage(org.openpdf.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(ITextFSFont font) voidsetMetadata(String name, String value) Replaces all copies of the named metadata with a single value.voidsetOpacity(float opacity) voidsetRenderingHint(RenderingHints.Key key, Object value) voidsetRoot(org.xhtmlrenderer.render.Box root) voidsetSharedContext(org.xhtmlrenderer.layout.SharedContext sharedContext) voidsetStartPageNo(int startPageNo) voidvoidsetWriter(org.openpdf.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, setFontSpecification
-
Constructor Details
-
ITextOutputDevice
public ITextOutputDevice(float dotsPerPoint)
-
-
Method Details
-
setWriter
public void setWriter(org.openpdf.text.pdf.PdfWriter writer) -
getWriter
public @Nullable org.openpdf.text.pdf.PdfWriter getWriter() -
getNextFormFieldIndex
public int getNextFormFieldIndex() -
initializePage
public void initializePage(org.openpdf.text.pdf.PdfContentByte currentPage, float height) -
finishPage
public void finishPage() -
paintReplacedElement
public void paintReplacedElement(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.BlockBox box) -
paintBackground
public void paintBackground(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) - Specified by:
paintBackgroundin interfaceorg.xhtmlrenderer.extend.OutputDevice<org.xhtmlrenderer.extend.FSImage,ITextFSFont> - Overrides:
paintBackgroundin classorg.xhtmlrenderer.render.AbstractOutputDevice<org.xhtmlrenderer.extend.FSImage,ITextFSFont>
-
createLocalTargetArea
public org.openpdf.text.Rectangle createLocalTargetArea(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) -
createTargetArea
public org.openpdf.text.Rectangle createTargetArea(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box box) -
getDeviceLength
public float getDeviceLength(float length) -
drawBorderLine
-
setOpacity
public void setOpacity(float opacity) -
setColor
public void setColor(org.xhtmlrenderer.css.parser.FSColor color) -
draw
-
drawLine
protected void drawLine(int x1, int y1, int x2, int y2) - Specified by:
drawLinein classorg.xhtmlrenderer.render.AbstractOutputDevice<org.xhtmlrenderer.extend.FSImage,ITextFSFont>
-
drawRect
public void drawRect(int x, int y, int width, int height) -
drawOval
public void drawOval(int x, int y, int width, int height) -
fill
-
fillRect
public void fillRect(int x, int y, int width, int height) -
fillOval
public void fillOval(int x, int y, int width, int height) -
translate
public void translate(double tx, double ty) -
getRenderingHint
-
setRenderingHint
-
setFont
-
drawString
public void drawString(String s, float x, float y, @Nullable org.xhtmlrenderer.render.JustificationInfo info) -
getTransform
-
getCurrentPage
public org.openpdf.text.pdf.PdfContentByte getCurrentPage() -
setStroke
-
clip
-
getClip
-
setClip
-
getStroke
-
drawImage
public void drawImage(org.xhtmlrenderer.extend.FSImage fsImage, int x, int y) -
drawLinearGradient
public void drawLinearGradient(org.xhtmlrenderer.css.style.derived.FSLinearGradient gradient, int x, int y, int width, int height) -
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) -
isSupportsSelection
public boolean isSupportsSelection() -
isSupportsCMYKColors
public boolean isSupportsCMYKColors() -
findPagePositionsByID
public List<PagePosition> findPagePositionsByID(org.xhtmlrenderer.css.style.CssContext c, Pattern pattern)
-