Package com.openhtmltopdf.java2d
Class Java2DRenderer
- java.lang.Object
-
- com.openhtmltopdf.java2d.Java2DRenderer
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class Java2DRenderer extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description private byte
_defaultTextDirection
private org.w3c.dom.Document
_doc
private java.util.List<FSDOMMutator>
_domMutators
private int
_initialPageNo
private SVGDrawer
_mathMLImpl
private FSObjectDrawerFactory
_objectDrawerFactory
private Java2DOutputDevice
_outputDevice
private FSPageProcessor
_pageProcessor
private short
_pagingMode
private BidiReorderer
_reorderer
private BlockBox
_root
private SharedContext
_sharedContext
private BidiSplitterFactory
_splitterFactory
private SVGDrawer
_svgImpl
private static int
DEFAULT_DOTS_PER_PIXEL
private static int
DEFAULT_DPI
private java.io.Closeable
diagnosticConsumer
-
Constructor Summary
Constructors Constructor Description Java2DRenderer(BaseDocument doc, UnicodeImplementation unicode, PageDimensions pageSize, Java2DRendererBuilderState state, java.io.Closeable diagnosticConsumer)
Subject to change.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Java2DFontResolver
getFontResolver()
private java.awt.Rectangle
getInitialExtents(LayoutContext c)
int
getPageCount()
void
layout()
private org.w3c.dom.Document
loadDocument(java.lang.String uri)
private LayoutContext
newLayoutContext()
private RenderingContext
newRenderingContext()
private void
paintPage(RenderingContext c, PageBox page, DisplayListContainer.DisplayListPageContainer pageOperations)
private void
setDocument(java.io.File file)
private void
setDocument(java.lang.String uri)
private void
setDocument(org.w3c.dom.Document doc, java.lang.String url)
private void
setDocument(org.w3c.dom.Document doc, java.lang.String url, NamespaceHandler nsh)
private void
setDocumentFromString(java.lang.String content, java.lang.String baseUrl)
void
writePage(int zeroBasedPageNumber)
private void
writePageImages(java.util.List<PageBox> pages, RenderingContext c, java.awt.geom.Rectangle2D firstPageSize)
void
writePages()
void
writeSinglePage()
-
-
-
Field Detail
-
_domMutators
private final java.util.List<FSDOMMutator> _domMutators
-
_mathMLImpl
private final SVGDrawer _mathMLImpl
-
_root
private BlockBox _root
-
_sharedContext
private final SharedContext _sharedContext
-
_outputDevice
private final Java2DOutputDevice _outputDevice
-
_splitterFactory
private BidiSplitterFactory _splitterFactory
-
_defaultTextDirection
private byte _defaultTextDirection
-
_reorderer
private BidiReorderer _reorderer
-
_svgImpl
private final SVGDrawer _svgImpl
-
_doc
private org.w3c.dom.Document _doc
-
_objectDrawerFactory
private final FSObjectDrawerFactory _objectDrawerFactory
-
_pageProcessor
private final FSPageProcessor _pageProcessor
-
DEFAULT_DOTS_PER_PIXEL
private static final int DEFAULT_DOTS_PER_PIXEL
- See Also:
- Constant Field Values
-
DEFAULT_DPI
private static final int DEFAULT_DPI
- See Also:
- Constant Field Values
-
_initialPageNo
private final int _initialPageNo
-
_pagingMode
private final short _pagingMode
-
diagnosticConsumer
private final java.io.Closeable diagnosticConsumer
-
-
Constructor Detail
-
Java2DRenderer
public Java2DRenderer(BaseDocument doc, UnicodeImplementation unicode, PageDimensions pageSize, Java2DRendererBuilderState state, java.io.Closeable diagnosticConsumer)
Subject to change. Not public API. Used exclusively by the Java2DRendererBuilder class.
-
-
Method Detail
-
setDocumentFromString
private void setDocumentFromString(java.lang.String content, java.lang.String baseUrl)
-
setDocument
private void setDocument(org.w3c.dom.Document doc, java.lang.String url)
-
setDocument
private void setDocument(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
setDocument
private void setDocument(java.lang.String uri)
-
loadDocument
private org.w3c.dom.Document loadDocument(java.lang.String uri)
-
setDocument
private void setDocument(org.w3c.dom.Document doc, java.lang.String url, NamespaceHandler nsh)
-
getFontResolver
public Java2DFontResolver getFontResolver()
-
layout
public void layout()
-
getInitialExtents
private java.awt.Rectangle getInitialExtents(LayoutContext c)
-
newRenderingContext
private RenderingContext newRenderingContext()
-
newLayoutContext
private LayoutContext newLayoutContext()
-
writePages
public void writePages() throws java.io.IOException
- Throws:
java.io.IOException
-
writePage
public void writePage(int zeroBasedPageNumber) throws java.io.IOException
- Throws:
java.io.IOException
-
writeSinglePage
public void writeSinglePage()
-
getPageCount
public int getPageCount()
-
writePageImages
private void writePageImages(java.util.List<PageBox> pages, RenderingContext c, java.awt.geom.Rectangle2D firstPageSize) throws java.io.IOException
- Throws:
java.io.IOException
-
paintPage
private void paintPage(RenderingContext c, PageBox page, DisplayListContainer.DisplayListPageContainer pageOperations)
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-