I have a project that i'm working on using Python and GhostScript. Currently I have a PDF file with several hundred pages, I need to take this PDF and seperate the pages into TIF Files, I have the code up and running correctly, however as this program can take some time to complete, I would like to have an output to the user showing how far in the process it is.
gs_appdir = 'C:\\Program Files\\gs\\gs9.10\\bin\\'
os.chdir(gs_appdir)
args = "-o \""+wkgdir+"Images\\Image_%03d.tif\" -sDEVICE=tiffg4 -q -NODISPLAY -r200x200 -s \""+inPDFFile+"\""
os.system("gswin64c.exe %s" % args)
When I take the -q parameter out of the arguments it will show me, however it will go line by line by line:
Page 1 of xxxx
Page 2 of xxxx
Page 3 of xxxx
...et c.
I would like to do something similar to this:
print "\r[ Preparing Images ] %s%%" % ((img+1)*100/imgcount),
Where it will print the percentage on the same line, however i'm not quite sure how to accomplish this using GhostScript. Any advice would be greatly appriciated.