Any suggestions on how to get a progress bar displayed as the pdf is being created?
Forum › How do I...?
progress bar
If you're writing a web application, eg. calling Prince from PHP, then I think it would be easiest to display an animated image to indicate to the user that work is in progress, such as a spinning disc or similar. Trying to display the exact time to completion requires dynamically updating the page while the existing request is in progress and is probably more effort than it is worth.
If you're writing a desktop application then the update issue becomes easier, and you can try running Prince with the --progress command-line option, which combined with the --server option will print easily readable messages giving the current progress percentage, eg. "prg|50".
If you're writing a desktop application then the update issue becomes easier, and you can try running Prince with the --progress command-line option, which combined with the --server option will print easily readable messages giving the current progress percentage, eg. "prg|50".
How reliable is this? I tried doing this and my results were less than helpful.
sta|Converting document...
prg|99
prg|100
prg|99
prg|100
prg|99
prg|100
prg|99
prg|100
prg|99
prg|99
prg|100
prg|99
prg|100
prg|96
prg|96
prg|97
prg|97
prg|98
prg|99
prg|100
prg|96
prg|96
prg|97
prg|98
prg|99
prg|99
prg|100
prg|97
prg|97
prg|97
prg|98
prg|99
prg|99
prg|100
prg|98
prg|98
prg|99
prg|100
prg|99
prg|100
prg|99
prg|100
prg|99
prg|100
prg|99
prg|99
prg|100
prg|96
prg|96
prg|96
prg|98
...
prg|100
fin|success
sta|Converting document...
prg|99
prg|100
prg|99
prg|100
prg|99
prg|100
prg|99
prg|100
prg|99
prg|99
prg|100
prg|99
prg|100
prg|96
prg|96
prg|97
prg|97
prg|98
prg|99
prg|100
prg|96
prg|96
prg|97
prg|98
prg|99
prg|99
prg|100
prg|97
prg|97
prg|97
prg|98
prg|99
prg|99
prg|100
prg|98
prg|98
prg|99
prg|100
prg|99
prg|100
prg|99
prg|100
prg|99
prg|100
prg|99
prg|99
prg|100
prg|96
prg|96
prg|96
prg|98
...
prg|100
fin|success
Edited by jbarrus
Yikes, that's not very helpful!
Do you have a sample document that produces this behaviour that you could email to me? (mikeday@yeslogic.com)
Do you have a sample document that produces this behaviour that you could email to me? (mikeday@yeslogic.com)
Today we have released Prince 6.0 rev 8, which fixes the bug causing the progress counter to reset every time it hits a forced page break. Thanks for letting us know.
What does the
--server
option do? I would be interested in having prince running as a daemon in the background to speed up launch times, but I don't know if that's possible.
The --server option changes the format of the output messages to make them easier to parse by a server process instead of being read by a human. We've tried keeping Prince processes running between requests, but didn't see any performance benefits relative to the increased complexity and potential for error. On Linux in particular there is not enough overhead associated with repeated process creation to make this worthwhile.
The --progress option has been made redundant, as --server already implies it. (And --server is actually now just a shorthand for --structured-log=progress).
Also my earlier post from 2009 may need some modification:
For converting many very small documents the overhead of process creation can actually be a significant factor due to shared library linkage time, and we are experimenting with a new control interface to perform multiple consecutive document conversions with a single persistent Prince process.
Also my earlier post from 2009 may need some modification:
We've tried keeping Prince processes running between requests, but didn't see any performance benefits relative to the increased complexity and potential for error. On Linux in particular there is not enough overhead associated with repeated process creation to make this worthwhile.
For converting many very small documents the overhead of process creation can actually be a significant factor due to shared library linkage time, and we are experimenting with a new control interface to perform multiple consecutive document conversions with a single persistent Prince process.