Class HTMLWorker

    • Constructor Detail

      • HTMLWorker

        public HTMLWorker​(DocListener document)
        Creates a new instance of HTMLWorker
        Parameters:
        document - A class that implements DocListener
    • Method Detail

      • getStyleSheet

        public StyleSheet getStyleSheet()
      • setStyleSheet

        public void setStyleSheet​(StyleSheet style)
      • setInterfaceProps

        public void setInterfaceProps​(Map<String,​Object> interfaceProps)
      • text

        public void text​(String str)
        Description copied from interface: SimpleXMLDocHandler
        Called when a text element is found.
        Specified by:
        text in interface SimpleXMLDocHandler
        Parameters:
        str - the text element, probably a fragment.
      • add

        public boolean add​(Element element)
                    throws DocumentException
        Description copied from interface: ElementListener
        Signals that an Element was added to the Document.
        Specified by:
        add in interface ElementListener
        Parameters:
        element - a high level object
        Returns:
        true if the element was added, false if not.
        Throws:
        DocumentException - when a document isn't open yet, or has been closed
      • close

        public void close()
        Description copied from interface: DocListener
        Signals that the Document was closed and that no other Elements will be added.

        The outputstream of every writer implementing DocListener will be closed.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface DocListener
      • newPage

        public boolean newPage()
        Description copied from interface: DocListener
        Signals that an new page has to be started.
        Specified by:
        newPage in interface DocListener
        Returns:
        true if the page was added, false if not.
      • open

        public void open()
        Description copied from interface: DocListener
        Signals that the Document has been opened and that Elements can be added.
        Specified by:
        open in interface DocListener
      • resetFooter

        public void resetFooter()
        Description copied from interface: DocListener
        Resets the footer of this document.
        Specified by:
        resetFooter in interface DocListener
      • resetHeader

        public void resetHeader()
        Description copied from interface: DocListener
        Resets the header of this document.
        Specified by:
        resetHeader in interface DocListener
      • setFooter

        public void setFooter​(HeaderFooter footer)
        Description copied from interface: DocListener
        Changes the footer of this document.
        Specified by:
        setFooter in interface DocListener
        Parameters:
        footer - the new footer
      • setHeader

        public void setHeader​(HeaderFooter header)
        Description copied from interface: DocListener
        Changes the header of this document.
        Specified by:
        setHeader in interface DocListener
        Parameters:
        header - the new header
      • setMarginMirroring

        public boolean setMarginMirroring​(boolean marginMirroring)
        Description copied from interface: DocListener
        Allows you to do left/right margin mirroring (odd/even pages)
        Specified by:
        setMarginMirroring in interface DocListener
        Parameters:
        marginMirroring - left/right margin mirroring (odd/even pages)
        Returns:
        true if successful
      • setMarginMirroringTopBottom

        public boolean setMarginMirroringTopBottom​(boolean marginMirroring)
        Description copied from interface: DocListener
        Parameter that allows you to do top/bottom margin mirroring (odd/even pages)
        Specified by:
        setMarginMirroringTopBottom in interface DocListener
        Parameters:
        marginMirroring - top/bottom margin mirroring (odd/even pages)
        Returns:
        true if successful
        Since:
        2.1.6
        See Also:
        DocListener.setMarginMirroring(boolean)
      • setMargins

        public boolean setMargins​(float marginLeft,
                                  float marginRight,
                                  float marginTop,
                                  float marginBottom)
        Description copied from interface: DocListener
        Sets the margins.
        Specified by:
        setMargins in interface DocListener
        Parameters:
        marginLeft - the margin on the left
        marginRight - the margin on the right
        marginTop - the margin on the top
        marginBottom - the margin on the bottom
        Returns:
        a boolean
      • setPageCount

        public void setPageCount​(int pageN)
        Description copied from interface: DocListener
        Sets the page number.
        Specified by:
        setPageCount in interface DocListener
        Parameters:
        pageN - the new page number
      • setPageSize

        public boolean setPageSize​(Rectangle pageSize)
        Description copied from interface: DocListener
        Sets the pagesize.
        Specified by:
        setPageSize in interface DocListener
        Parameters:
        pageSize - the new pagesize
        Returns:
        a boolean