Page 1 of 1

"-info" switch problem...

Posted: Wed Dec 25, 2013 6:59 pm
by sasho
hi all,

I'm using linux version of nconvert to convert PDF to PNG on the fly using php exec command and ghostscript and it works just fine as long as I don't specify "-info" as a part of command line. it looks something like this:

Code: Select all

<?php exec('/usr/local/nconvert -overwrite -out png -dpi 300 -ratio -resize 600 0 -colors 256 '.$move_to, $cvt_res); ?>
$move_to is name of PDF file I want to converted, and $cvt_res should be array filled with result of conversion (and lot of other stuff too). That is true if "-info" switch is specified, otherwise $cvt_res contains just copyright info wich is of no special use. I need this to test if conversion passed ok in $cvt_res[5] (if I'm not wrong). But once I specify "-info" switch like:

Code: Select all

<?php exec('/usr/local/nconvert -info -overwrite -out png -dpi 300 -ratio -resize 600 0 -colors 256 '.$move_to, $cvt_res); ?>
nconvert will not convert my files anymore. it seems like "-info" switch turns off actual conversion and works just like info.

Any hints or clues maybe?
Thanx...

Re: "-info" switch problem...

Posted: Thu Dec 26, 2013 8:09 am
by xnview
yes -info will display only information about the file

Re: "-info" switch problem...

Posted: Thu Dec 26, 2013 11:25 am
by sasho
so do you suggest me to call nconvert twice?
first time to check error and then if all is ok, do the actual conversion, or something else?

thanx...

Re: "-info" switch problem...

Posted: Thu Dec 26, 2013 2:31 pm
by xnview
sasho wrote:so do you suggest me to call nconvert twice?
first time to check error and then if all is ok, do the actual conversion, or something else?
yes, or do you think that command following -info must be executed?