Forum How do I...?

Progress report

jsweetman
Hi

Well done with the new release of prince - looking really good and we are very pleased with the results we are getting.

The pdfs that we are generating are quite large and take a long time to produce. I was wondering if there was any way of providing feedback to the user (in terms of a progress bar or stages that had been completed) as to how long they had to wait for the process to finish?

If not we may be able to achieve the same result by taking an average time and doing a progress bar in that way.

Thanks for the help and keep up the good work!

<><

mikeday
Just out of curiosity, how large are the PDF files that you are generating, in page count and file size? Roughly how long do they take to process? Prince 6.0 should perform a bit better than Prince 5.1 for certain workloads, but we are always interested in finding new ways to improve performance.

For progress, you can try passing the "--progress" option to Prince on the command-line, which will report the current percentage completion. However, this functionality is not yet available through the Java/COM/.Net interfaces.
jsweetman
Thanks for the quick response,

The pdf files we are producing are approx 80 pages and around 15Mb in size. This is mainly due to the fact, I think, that we use high quality tiff images within the file. They take about a minute to produce on the server which isn't very long at all but in web terms it's easy for users to think that something has gone wrong.

Unfortunately we are using Coldfusion on the server with the Java interface so it sounds as though I won't be able to pass the --progress option.

<><

mikeday
For a web application like this it would probably be best to display some kind of moving progress bar or "Please wait..." indication with Javascript like many sites do, as actually getting the Prince progress and sending it back to the browser would be rather fiddly. The user does not really need to know the exact progress, just that things are happening and that they don't need to hit Refresh in their browser.

Given that your PDF files are only 80 pages long, it seems like it must be the TIFF image handling that is taking the time. If you have a sample document with images that you could email to us then we could use it for profiling Prince to see if we can improve the performance for this workload. If you don't have one handy we'll try making one ourselves and see how we go. :)