HTML to PDF / DOCX / RTF Java converter library Forums PD4ML v3 Archived Forums (Read Only) General questions / FAQ Progress Monitor/Feedback mechanism during PDF generation

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #26613

    I am looking for a way that I can provide some progress feedback to my users about the state of the HTML/PDF conversion. I don’t see anything within the Java API that would allow me to register any sort of conversion status callback.

    Is there a way that people are providing feedback to their clients? I’m using the Java API within an app and not in a web server environment.

    Thanks,
    Thomas

    #28682

    Currently PD4ML offers no such API.

    We are ready to implement it by request – please contact support pd4ml com

    #28683

    I noticed the new 3.8.0 version allows for progress monitoring. Is there a simple example somewhere of how to use the API for this feature?

    #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]

    #28685

    Many thanks… I will check it out.

    #28686

    Am I mistaken or does the current downloadable version of pd4ml.pro.trial.380.zip not include the new PD4ProgressListener interface? I have included a screenshot of the jar file dir “org/zefer/pd4ml”. The API documentation seems to be correct in the zip file though

    Also, the API on the website (http://pd4ml.com/api/index.html) uses an older version and makes no mention of the PD4ProgressListener interface.

    Thanks,
    Burton

Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.