示例#1
0
        public static void JoinPDFs(string[] PDFPaths, string name)
        {
            string args = "-join -profile \"default/medium\" -outputFile \"" + name + "\" ";

            foreach (string s in PDFPaths)
            {
                args += "\"" + s + "\" ";
            }
            args = args.Substring(0, args.Length - 1);
            PDF24.Run(args);
        }
示例#2
0
 public static bool Run(string args)
 {
     if (PDF24.Exists())
     {
         Process PDF24P = new Process();
         PDF24P.StartInfo.FileName  = Program.Sett.PDF24;
         PDF24P.StartInfo.Arguments = args;
         PDF24P.Start();
         PDF24P.WaitForExit();
         return(true);
     }
     else
     {
         MessageBox.Show("PDF24 konnte nicht gefunden werden!\nFragen Sie gegebenenfalls Ihren Administrator um Rat.", "PDF24 nicht gefunden", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return(false);
     }
 }
示例#3
0
        public static string[] SplitPDF(string PDFPath)
        {
            string path = AbsolutCachePath(PDFPath);

            if (!Directory.Exists(path))
            {
                MessageBox.Show("Das Überverzeichnis für den Chache existiert nicht!\nFragen Sie gegebenenfalls Ihren Administrator um Rat.", "Ordner nicht vorhanden", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }
            //Directory.CreateDirectory(path + @"\Cache"); replaced to create hidden directory
            if (!Directory.Exists(path + @"\Cache"))
            {
                DirectoryInfo di = Directory.CreateDirectory(path + @"\Cache");
                di.Attributes = FileAttributes.Directory | FileAttributes.Hidden;
            }
            string args = "-splitByPage -outputDir \"" + path + "\\Cache\" \"" + PDFPath + "\"";

            if (PDF24.Run(args))
            {
                return(Directory.GetFiles(path + @"\Cache\" + new FileInfo(PDFPath).Name));
            }
            return(null);
        }