示例#1
0
        public static void ConvertToCMYKPdf(string inputfile, string outputfile)
        {
            try
            {
                var args             = string.Format(GhostScriptArgs, inputfile, outputfile);
                var processStartInfo = new ProcessStartInfo(GhostScriptExe, args);
                processStartInfo.RedirectStandardInput = true;
                processStartInfo.UseShellExecute       = false;
                processStartInfo.CreateNoWindow        = true;

                var process = new Process();
                ImpersonateUserProcess.Impersonate(process);
                process.StartInfo = processStartInfo;
                process.Start();
                process.WaitForExit();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
            }
        }
示例#2
0
        public static void ExportPdf(string inputfile, string outputfile, int dpi = 600)
        {
            try
            {
                var args             = string.Format(InkscapePdfArgs, inputfile, outputfile, dpi);
                var processStartInfo = new ProcessStartInfo(InkscapeExe, args);
                processStartInfo.RedirectStandardInput = true;
                processStartInfo.UseShellExecute       = false;
                processStartInfo.CreateNoWindow        = true;

                var process = new Process();
                ImpersonateUserProcess.Impersonate(process);
                process.StartInfo = processStartInfo;
                process.Start();
                process.WaitForExit();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
            }
        }