Package com.pd4ml

Interface ProgressListener


  • public interface ProgressListener
    Receives progress notifications during a conversion, for example to update a progress bar or to log timing information. Register an implementation with PD4ML.monitorProgressWith(ProgressListener).

    The constants identify the conversion stage of a notification (the messageID argument). Implementations are called on the conversion thread and should return quickly.

    • Field Detail

      • CONVERSION_BEGIN

        static final int CONVERSION_BEGIN
        The conversion has started.
        See Also:
        Constant Field Values
      • MAIN_DOC_READ

        static final int MAIN_DOC_READ
        The source document has been loaded.
        See Also:
        Constant Field Values
      • HTML_PARSED

        static final int HTML_PARSED
        The source document has been parsed.
        See Also:
        Constant Field Values
      • RENDERER_TREE_BUILT

        static final int RENDERER_TREE_BUILT
        The layout structure has been built from the parsed document.
        See Also:
        Constant Field Values
      • HTML_LAYOUT_IN_PROGRESS

        static final int HTML_LAYOUT_IN_PROGRESS
        The layout is in progress; sent repeatedly.
        See Also:
        Constant Field Values
      • HTML_LAYOUT_DONE

        static final int HTML_LAYOUT_DONE
        The layout is complete.
        See Also:
        Constant Field Values
      • PAGEBREAKS_ALIGNED

        static final int PAGEBREAKS_ALIGNED
        The content has been distributed across pages.
        See Also:
        Constant Field Values
      • TOC_GENERATED

        static final int TOC_GENERATED
        The table of contents has been generated.
        See Also:
        Constant Field Values
      • DOC_RENDER_IN_PROGRESS

        static final int DOC_RENDER_IN_PROGRESS
        Pages are being rendered; sent once per page, with the page number as the message.
        See Also:
        Constant Field Values
      • DOC_WRITE_BEGIN

        static final int DOC_WRITE_BEGIN
        Writing the output has started.
        See Also:
        Constant Field Values
      • CONVERSION_END

        static final int CONVERSION_END
        The conversion is complete.
        See Also:
        Constant Field Values
      • RTF_PRE_RENDER_DONE

        static final int RTF_PRE_RENDER_DONE
        The preparation of RTF output is complete.
        See Also:
        Constant Field Values
      • DOCX_PRE_RENDER_DONE

        static final int DOCX_PRE_RENDER_DONE
        The preparation of DOCX output is complete.
        See Also:
        Constant Field Values
    • Method Detail

      • progressUpdate

        void progressUpdate​(int messageID,
                            int progress,
                            java.lang.String message,
                            long msec)
        Called at each stage of the conversion.
        Parameters:
        messageID - the conversion stage, one of the constants of this interface
        progress - the estimated progress of the whole conversion, in percent (0 to 100)
        message - details about the stage, or null
        msec - the time elapsed since the start of the conversion, in milliseconds