Class HTMLWorker

    • Field Detail

      • document

        protected DocListener document
        Deprecated.
        DocListener that will listen to the Elements produced by parsing the HTML. This can be a com.lowagie.text.Document adding the elements to a Document directly, or an HTMLWorker instance strong the objects in a List
      • stack

        protected Stack<Element> stack
        Deprecated.
        Stack with the Elements that already have been processed.
        Since:
        iText 5.0.6 (private => protected)
      • currentParagraph

        protected Paragraph currentParagraph
        Deprecated.
        Keeps the content of the current paragraph
        Since:
        iText 5.0.6 (private => protected)
      • IMG_PROVIDER

        public static final String IMG_PROVIDER
        Deprecated.
        Key used to store the image provider in the providers map.
        Since:
        5.0.6
        See Also:
        Constant Field Values
      • IMG_PROCESSOR

        public static final String IMG_PROCESSOR
        Deprecated.
        Key used to store the image processor in the providers map.
        Since:
        5.0.6
        See Also:
        Constant Field Values
      • IMG_STORE

        public static final String IMG_STORE
        Deprecated.
        Key used to store the image store in the providers map.
        Since:
        5.0.6
        See Also:
        Constant Field Values
      • IMG_BASEURL

        public static final String IMG_BASEURL
        Deprecated.
        Key used to store the image baseurl provider in the providers map.
        Since:
        5.0.6
        See Also:
        Constant Field Values
      • FONT_PROVIDER

        public static final String FONT_PROVIDER
        Deprecated.
        Key used to store the font provider in the providers map.
        Since:
        5.0.6
        See Also:
        Constant Field Values
      • LINK_PROVIDER

        public static final String LINK_PROVIDER
        Deprecated.
        Key used to store the link provider in the providers map.
        Since:
        5.0.6
        See Also:
        Constant Field Values
      • skipText

        protected boolean skipText
        Deprecated.
        Indicates if text needs to be skipped.
        Since:
        iText 5.0.6 (private => protected)
      • objectList

        protected List<Element> objectList
        Deprecated.
        The resulting list of elements.
    • Constructor Detail

      • HTMLWorker

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

        public HTMLWorker​(DocListener document,
                          Map<String,​HTMLTagProcessor> tags,
                          StyleSheet style)
        Deprecated.
        Creates a new instance of HTMLWorker
        Parameters:
        document - A class that implements DocListener
        tags - A map containing the supported tags
        style - A StyleSheet
        Since:
        5.0.6
    • Method Detail

      • setSupportedTags

        public void setSupportedTags​(Map<String,​HTMLTagProcessor> tags)
        Deprecated.
        Sets the map with supported tags.
        Parameters:
        tags -
        Since:
        5.0.6
      • setStyleSheet

        public void setStyleSheet​(StyleSheet style)
        Deprecated.
        Setter for the StyleSheet
        Parameters:
        style - the StyleSheet
      • parse

        public void parse​(Reader reader)
                   throws IOException
        Deprecated.
        Parses content read from a java.io.Reader object.
        Parameters:
        reader - the content
        Throws:
        IOException
      • newLine

        public void newLine()
        Deprecated.
        Adds a new line to the currentParagraph.
        Since:
        5.0.6
      • carriageReturn

        public void carriageReturn()
                            throws DocumentException
        Deprecated.
        Flushes the current paragraph, indicating that we're starting a new block. If the stack is empty, the paragraph is added to the document. Otherwise the Paragraph is added to the stack.
        Throws:
        DocumentException
        Since:
        5.0.6
      • flushContent

        public void flushContent()
        Deprecated.
        Stacks the current paragraph, indicating that we're starting a new span.
        Since:
        5.0.6
      • pushToStack

        public void pushToStack​(Element element)
        Deprecated.
        Pushes an element to the Stack.
        Parameters:
        element -
        Since:
        5.0.6
      • updateChain

        public void updateChain​(String tag,
                                Map<String,​String> attrs)
        Deprecated.
        Updates the chain with a new tag and new attributes.
        Parameters:
        tag - the new tag
        attrs - the corresponding attributes
        Since:
        5.0.6
      • updateChain

        public void updateChain​(String tag)
        Deprecated.
        Updates the chain by removing a tag.
        Parameters:
        tag - the new tag
        Since:
        5.0.6
      • setProviders

        public void setProviders​(Map<String,​Object> providers)
        Deprecated.
        Setter for the providers. If a FontProvider is added, the ElementFactory is updated.
        Parameters:
        providers - a Map with different providers
        Since:
        5.0.6
      • createChunk

        public Chunk createChunk​(String content)
        Deprecated.
        Creates a Chunk using the factory.
        Parameters:
        content - the content of the chunk
        Returns:
        a Chunk with content
        Since:
        5.0.6
      • createParagraph

        public Paragraph createParagraph()
        Deprecated.
        Creates a Paragraph using the factory.
        Returns:
        a Paragraph without any content
        Since:
        5.0.6
      • createList

        public List createList​(String tag)
        Deprecated.
        Creates a List object.
        Parameters:
        tag - should be "ol" or "ul"
        Returns:
        a List object
        Since:
        5.0.6
      • createListItem

        public ListItem createListItem()
        Deprecated.
        Creates a ListItem object.
        Returns:
        a ListItem object
        Since:
        5.0.6
      • createLineSeparator

        public LineSeparator createLineSeparator​(Map<String,​String> attrs)
        Deprecated.
        Creates a LineSeparator object.
        Parameters:
        attrs - properties of the LineSeparator
        Returns:
        a LineSeparator object
        Since:
        5.0.6
      • createCell

        public CellWrapper createCell​(String tag)
        Deprecated.
        Creates a Cell.
        Parameters:
        tag - the tag
        Returns:
        a CellWrapper object
        Since:
        5.0.6
      • processLink

        public void processLink()
        Deprecated.
        Adds a link to the current paragraph.
        Since:
        5.0.6
      • processList

        public void processList()
                         throws DocumentException
        Deprecated.
        Fetches the List from the Stack and adds it to the TextElementArray on top of the Stack, or to the Document if the Stack is empty.
        Throws:
        DocumentException
        Since:
        5.0.6
      • processListItem

        public void processListItem()
                             throws DocumentException
        Deprecated.
        Looks for the List object on the Stack, and adds the ListItem to the List.
        Throws:
        DocumentException
        Since:
        5.0.6
      • processRow

        public void processRow()
        Deprecated.
        Gets the TableWrapper from the Stack and adds a new row.
        Since:
        5.0.6
      • pushTableState

        public void pushTableState()
        Deprecated.
        Pushes the values of pendingTR and pendingTD to a state stack.
        Since:
        5.0.6
      • popTableState

        public void popTableState()
        Deprecated.
        Pops the values of pendingTR and pendingTD from a state stack.
        Since:
        5.0.6
      • isPendingTR

        public boolean isPendingTR()
        Deprecated.
        Returns:
        the pendingTR
        Since:
        5.0.6
      • setPendingTR

        public void setPendingTR​(boolean pendingTR)
        Deprecated.
        Parameters:
        pendingTR - the pendingTR to set
        Since:
        5.0.6
      • isPendingTD

        public boolean isPendingTD()
        Deprecated.
        Returns:
        the pendingTD
        Since:
        5.0.6
      • setPendingTD

        public void setPendingTD​(boolean pendingTD)
        Deprecated.
        Parameters:
        pendingTD - the pendingTD to set
        Since:
        5.0.6
      • isPendingLI

        public boolean isPendingLI()
        Deprecated.
        Returns:
        the pendingLI
        Since:
        5.0.6
      • setPendingLI

        public void setPendingLI​(boolean pendingLI)
        Deprecated.
        Parameters:
        pendingLI - the pendingLI to set
        Since:
        5.0.6
      • isInsidePRE

        public boolean isInsidePRE()
        Deprecated.
        Returns:
        the insidePRE
        Since:
        5.0.6
      • setInsidePRE

        public void setInsidePRE​(boolean insidePRE)
        Deprecated.
        Parameters:
        insidePRE - the insidePRE to set
        Since:
        5.0.6
      • isSkipText

        public boolean isSkipText()
        Deprecated.
        Returns:
        the skipText
        Since:
        5.0.6
      • setSkipText

        public void setSkipText​(boolean skipText)
        Deprecated.
        Parameters:
        skipText - the skipText to set
        Since:
        5.0.6
      • parseToList

        public static List<Element> parseToList​(Reader reader,
                                                StyleSheet style)
                                         throws IOException
        Deprecated.
        Parses an HTML source to a List of Element objects
        Parameters:
        reader - the HTML source
        style - a StyleSheet object
        Returns:
        a List of Element objects
        Throws:
        IOException
      • parseToList

        public static List<Element> parseToList​(Reader reader,
                                                StyleSheet style,
                                                HashMap<String,​Object> providers)
                                         throws IOException
        Deprecated.
        Parses an HTML source to a List of Element objects
        Parameters:
        reader - the HTML source
        style - a StyleSheet object
        providers - map containing classes with extra info
        Returns:
        a List of Element objects
        Throws:
        IOException
      • parseToList

        public static List<Element> parseToList​(Reader reader,
                                                StyleSheet style,
                                                Map<String,​HTMLTagProcessor> tags,
                                                HashMap<String,​Object> providers)
                                         throws IOException
        Deprecated.
        Parses an HTML source to a List of Element objects
        Parameters:
        reader - the HTML source
        style - a StyleSheet object
        tags - a map containing supported tags and their processors
        providers - map containing classes with extra info
        Returns:
        a List of Element objects
        Throws:
        IOException
        Since:
        5.0.6
      • close

        public void close()
        Deprecated.
        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 DocListener
        See Also:
        DocListener.close()
      • newPage

        public boolean newPage()
        Deprecated.
        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.
        See Also:
        DocListener.newPage()
      • open

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

        public boolean setMargins​(float marginLeft,
                                  float marginRight,
                                  float marginTop,
                                  float marginBottom)
        Deprecated.
        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
        See Also:
        DocListener.setMargins(float, float, float, float)
      • setInterfaceProps

        @Deprecated
        public void setInterfaceProps​(HashMap<String,​Object> providers)
        Deprecated.
        use setProviders() instead
        Sets the providers.
      • getInterfaceProps

        @Deprecated
        public Map<String,​Object> getInterfaceProps()
        Deprecated.
        use getProviders() instead
        Gets the providers