Class ITextOutputDevice

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 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:
      paintBackground in interface org.xhtmlrenderer.extend.OutputDevice<org.xhtmlrenderer.extend.FSImage,ITextFSFont>
      Overrides:
      paintBackground in class org.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

      public void drawBorderLine(Shape bounds, int side, int lineWidth, boolean solid)
    • setOpacity

      public void setOpacity(float opacity)
    • setColor

      public void setColor(org.xhtmlrenderer.css.parser.FSColor color)
    • draw

      public void draw(Shape s)
    • drawLine

      protected void drawLine(int x1, int y1, int x2, int y2)
      Specified by:
      drawLine in class org.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

      public void fill(Shape s)
    • 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

      public @Nullable Object getRenderingHint(RenderingHints.Key key)
    • setRenderingHint

      public void setRenderingHint(RenderingHints.Key key, Object value)
    • setFont

      public void setFont(ITextFSFont font)
    • drawString

      public void drawString(String s, float x, float y, @Nullable org.xhtmlrenderer.render.JustificationInfo info)
    • getTransform

      public AffineTransform getTransform()
    • getCurrentPage

      public org.openpdf.text.pdf.PdfContentByte getCurrentPage()
    • setStroke

      public void setStroke(Stroke s)
    • clip

      public void clip(Shape s)
    • getClip

      public @Nullable Shape getClip()
    • setClip

      public void setClip(Shape s)
    • getStroke

      public Stroke 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

      public org.openpdf.text.pdf.PdfReader getReader(URI uri) throws IOException
      Throws:
      IOException
    • getDotsPerPoint

      public float getDotsPerPoint()
    • start

      public void start(Document doc)
    • finish

      public void finish(org.xhtmlrenderer.render.RenderingContext c, org.xhtmlrenderer.render.Box root)
    • addMetadata

      public void addMetadata(String name, String value)
      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

      public @Nullable 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. 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

      public List<String> 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. 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

      public void setMetadata(String name, String value)
      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. Use addMetadata to append additional values with the same name.
      Parameters:
      name - the metadata element name to locate.
    • getSharedContext

      public org.xhtmlrenderer.layout.SharedContext getSharedContext()
    • setSharedContext

      public void setSharedContext(org.xhtmlrenderer.layout.SharedContext sharedContext)
    • 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)