I am converting pdf file in postscript file using acroread command.
The conversion is successfull but it is too slow and almost uses 100% of CPU,
because of this my application hangs for some time and thus no user is able to do
anything.
The code i am using is:-
processBuilder = new ProcessBuilder("bash","-c","acroread -toPostScript -size "+width+"x"+height+" -optimizeForSpeed sample.pdf");
pp = processBuilder.start();
pp.waitFor();
Is there a way to speed up the process and make it to use less percentage of CPU.
Please help!!!!
I'd suggest you start by using strace on the command line to diagnose the problem. strace -tt -f acroread -toPostScript -size 1000x2500 -optimizeForSpeed sample.pdf.
I suspect you may find it spends a lot of time reading font files.
If you have a choice then poppler or Xpdf or even ghostscript should be more supported and performant options, especially considering acroread is now unsupported on linux.