public DrawToolProvider(ILog logger) { _tools.Add(new ToolProperties("/usr/bin/mutool", "draw -o {0} {1} {2}")); _tools.Add(new ToolProperties("/usr/bin/mudraw", "-o {0} {1} {2}")); foreach (var tool in _tools) { if (!File.Exists(tool.ToolName)) { continue; } _defaultTool = tool; logger.Info("Draw tool set to " + _defaultTool.ToolName); } }
private static void RunTool(ToolProperties tool, string filename, string outputDir, int?page, double scale) { var process = new Process { StartInfo = new ProcessStartInfo { FileName = tool.ToolName, Arguments = tool.GetArguments(filename, outputDir, page, scale), RedirectStandardOutput = true, UseShellExecute = false, CreateNoWindow = true, } }; process.Start(); process.StandardOutput.ReadToEnd(); process.WaitForExit(); }
public DrawToolProvider() { // 0 - drawResultPath // 1 - filename // 2 - page // 3 - dpi -r 72 default _tools.Add(new ToolProperties("/usr/bin/mutool", "draw -r {3} -o {0} {1} {2}")); _tools.Add(new ToolProperties("/usr/bin/mudraw", "-r {3} -o {0} {1} {2}")); foreach (var tool in _tools) { if (!File.Exists(tool.ToolName)) { continue; } _defaultTool = tool; //logger.Info("Draw tool set to " + _defaultTool.ToolName); } }
public void Run(ToolProperties tool, string filename, string outputDir, double scale) { RunTool(tool, filename, outputDir, null, scale); }
public void Run(ToolProperties tool, string filename, string outputDir) { RunTool(tool, filename, outputDir, null); }
public void Run(ToolProperties tool, string filename, string outputDir, int page) { RunTool(tool, filename, outputDir, page); }