Package org.apache.fop.area
Class RenderPagesModel
java.lang.Object
org.apache.fop.area.AreaTreeModel
org.apache.fop.area.RenderPagesModel
- Direct Known Subclasses:
CachedRenderPagesModel
This uses the AreaTreeModel to store the pages
Each page is either rendered if ready or prepared
for later rendering.
Once a page is rendered it is cleared to release the
contents but the PageViewport is retained. So even
though the pages are stored the contents are discarded.
-
Field Summary
Modifier and TypeFieldDescriptionprotected List<PageViewport>
Pages that have been prepared but not rendered yet.protected Renderer
The renderer that will render the pages.Fields inherited from class org.apache.fop.area.AreaTreeModel
currentPageSequence, log
-
Constructor Summary
ConstructorDescriptionRenderPagesModel
(FOUserAgent userAgent, String outputFormat, FontInfo fontInfo, OutputStream stream) Create a new render pages model with the given renderer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPage
(PageViewport page) Add a page to the render page model.protected boolean
checkPreparedPages
(PageViewport newPageViewport, boolean renderUnresolved) Check prepared pagesvoid
End the document.void
Handle an OffDocumentItemprotected void
preparePage
(PageViewport page) Prepare a page.protected void
renderPage
(PageViewport pageViewport) Renders the given page and notified about unresolved IDs if any.void
setDocumentLocale
(Locale locale) void
startPageSequence
(PageSequence pageSequence) Start a page sequence on this model.Methods inherited from class org.apache.fop.area.AreaTreeModel
getCurrentPageSequence, getPage, getPageCount, getPageSequenceCount
-
Field Details
-
renderer
The renderer that will render the pages. -
prepared
Pages that have been prepared but not rendered yet.
-
-
Constructor Details
-
RenderPagesModel
public RenderPagesModel(FOUserAgent userAgent, String outputFormat, FontInfo fontInfo, OutputStream stream) throws FOPException Create a new render pages model with the given renderer.- Parameters:
userAgent
- FOUserAgent object for processoutputFormat
- the MIME type of the output format to use (ex. "application/pdf").fontInfo
- FontInfo objectstream
- OutputStream- Throws:
FOPException
- if the renderer cannot be properly initialized
-
-
Method Details
-
setDocumentLocale
- Overrides:
setDocumentLocale
in classAreaTreeModel
- Parameters:
locale
- The locale of the document
-
startPageSequence
Start a page sequence on this model.- Overrides:
startPageSequence
in classAreaTreeModel
- Parameters:
pageSequence
- the page sequence about to start
-
addPage
Add a page to the render page model. If the page is finished it can be rendered immediately. If the page needs resolving then if the renderer supports out of order rendering it can prepare the page. Otherwise the page is added to a queue.- Overrides:
addPage
in classAreaTreeModel
- Parameters:
page
- the page to add to the model
-
checkPreparedPages
Check prepared pages- Parameters:
newPageViewport
- the new page being addedrenderUnresolved
- render pages with unresolved idref's (done at end-of-document processing)- Returns:
- true if the current page should be rendered false if the renderer doesn't support out of order rendering and there are pending pages
-
renderPage
Renders the given page and notified about unresolved IDs if any.- Parameters:
pageViewport
- the page to be rendered.
-
preparePage
Prepare a page. An unresolved page can be prepared if the renderer supports it and the page will be rendered later.- Parameters:
page
- the page to prepare
-
handleOffDocumentItem
Handle an OffDocumentItem- Overrides:
handleOffDocumentItem
in classAreaTreeModel
- Parameters:
oDI
- the extension to handle
-
endDocument
End the document. Render any end document OffDocumentItems Signal the end of the document for any processing.- Overrides:
endDocument
in classAreaTreeModel
- Throws:
SAXException
- if a problem was encountered.
-