org.apache.fop.area

## Class CachedRenderPagesModel

- java.lang.Object
- - org.apache.fop.area.AreaTreeModel
  - - org.apache.fop.area.RenderPagesModel
    - - org.apache.fop.area.CachedRenderPagesModel

-     public class CachedRenderPagesModel
      extends RenderPagesModel

  A simple cached render pages model. If the page is prepared for later rendering then this saves the page contents to a file and once the page is resolved the contents are reloaded.

- - ### Field Summary

    - ### Fields inherited from class org.apache.fop.area.RenderPagesModel

      `prepared, renderer`

    - ### Fields inherited from class org.apache.fop.area.AreaTreeModel

      `currentPageSequence, log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CachedRenderPagesModel(FOUserAgent userAgent, java.lang.String outputFormat, FontInfo fontInfo, java.io.OutputStream stream)` Main Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | `checkPreparedPages(PageViewport newpage, boolean renderUnresolved)` Check prepared pages
    `void` | `endDocument()` End the document.
    `protected void` | `savePage(PageViewport page)` Save a page.

    - ### Methods inherited from class org.apache.fop.area.RenderPagesModel

      `addPage, handleOffDocumentItem, preparePage, renderPage, setDocumentLocale, startPageSequence`

    - ### Methods inherited from class org.apache.fop.area.AreaTreeModel

      `getCurrentPageSequence, getPage, getPageCount, getPageSequenceCount`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CachedRenderPagesModel

          public CachedRenderPagesModel(FOUserAgent userAgent,
                                        java.lang.String outputFormat,
                                        FontInfo fontInfo,
                                        java.io.OutputStream stream)
                                 throws FOPException

      Main Constructor
      Parameters:
        `userAgent` - FOUserAgent object for process
        `outputFormat` - the MIME type of the output format to use (ex. "application/pdf").
        `fontInfo` - FontInfo object
        `stream` - OutputStream
      Throws:
        `FOPException` - if the renderer cannot be properly initialized

  - ### Method Detail

    - #### checkPreparedPages

          protected boolean checkPreparedPages(PageViewport newpage,
                                               boolean renderUnresolved)

      Check prepared pages
      Overrides:
        `checkPreparedPages` in class `RenderPagesModel`
      Parameters:
        `newpage` - the new page being added
        `renderUnresolved` - 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

    - #### savePage

          protected void savePage(PageViewport page)

      Save a page. It saves the contents of the page to a file.
      Parameters:
        `page` - the page to prepare

    - #### endDocument

          public void endDocument()
                           throws org.xml.sax.SAXException

      End the document. Render any end document OffDocumentItems Signal the end of the document for any processing.
      Overrides:
        `endDocument` in class `RenderPagesModel`
      Throws:
        `org.xml.sax.SAXException` - if a problem was encountered.

Copyright 1999-2021 The Apache Software Foundation. All Rights Reserved.