Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 public void Run(ToolProperties tool, string filename, string outputDir, double scale)
 {
     RunTool(tool, filename, outputDir, null, scale);
 }
Ejemplo n.º 5
0
 public void Run(ToolProperties tool, string filename, string outputDir)
 {
     RunTool(tool, filename, outputDir, null);
 }
Ejemplo n.º 6
0
 public void Run(ToolProperties tool, string filename, string outputDir, int page)
 {
     RunTool(tool, filename, outputDir, page);
 }