i'm tring to convert a .tiff image to .pdf, using IM 6.9.9-Q16 on Win Server 2012 R2 64bit by this command:
Code: Select all
convert -resample 200x200 pathTIFFfile pathPDFfile
but if i try to develop same thing on .NET using this command:
Code: Select all
public string modifyResolution(String fileName, string resolution, string imageName, Logger serviceLogger)
{
string converterPath = ConfigurationSettings.AppSettings["ResampleToolPath"];
string resampleDir = ConfigurationSettings.AppSettings["ResampleDir"];
string convertedPdf = resampleDir + imageName + ".pdf";
try
{
ProcessStartInfo pinfo = new ProcessStartInfo();
pinfo.UseShellExecute = true;
pinfo.RedirectStandardOutput = false;
pinfo.CreateNoWindow = true;
pinfo.FileName = converterPath;
pinfo.Arguments = "convert -resample " + resolution + "x" + resolution + " " + fileName + " " + convertedPdf;
Process proc = null;
try
{
proc = Process.Start(pinfo);
proc.WaitForExit();
}
catch (Exception ex)
{
serviceLogger.WriteMessage("PROCESS EXCEPTION", ex.Message + " | " + ex.StackTrace + " | " +ex.Source );
}
}
catch (Exception ex)
{
serviceLogger.WriteMessage("ERR", ex.Message + "/" + ex.InnerException.Message + "/" + ex.StackTrace);
return ex.Message + "/" + ex.InnerException.Message + "/" + ex.StackTrace;
}
return convertedPdf;
}
Thanks,
Dani.