#28684

Sorry, we still not updated the documentation.

The code below implements a simple dump of progress messages. Just combine the approach with your progress meter component state update.

The current implementation probably still needs some balance refining between HTML parding, layouting and PDF output phases. However on our test scenarios the progress indication looks more-less smooth.

[language=java:1e45c9tp]pd4ml.monitorProgress(new ProgressMeter());

public class ProgressMeter implements PD4ProgressListener {

public void progressUpdate(int messageID, int progress, String note, long msec) {
String tick = String.format( “%7d”, msec );
String progressString = String.format( “%3d”, progress );

String step = “”;
switch ( messageID ) {
case CONVERSION_BEGIN:
step = “conversion begin”;
break;
case HTML_PARSED:
step = “html parsed”;
break;
case DOC_TREE_BUILT:
step = “document tree structure built”;
break;
case HTML_LAYOUT_IN_PROGRESS:
step = “layouting…”;
break;
case HTML_LAYOUT_DONE:
step = “layout done”;
break;
case TOC_GENERATED:
step = “TOC generated”;
break;
case DOC_OUTPUT_IN_PROGRESS:
step = “generating PDF…”;
break;
case NEW_SRC_DOC_BEGIN:
step = “proceed to new source document”;
break;
case CONVERSION_END:
step = “done.”;
break;
}

System.out.println( tick + ” ” + progressString + ” ” + step + ” ” + note );

}
}[/language:1e45c9tp]