Advertisement
Guest User

Untitled

a guest
Dec 16th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. Process process = new Process();
  2.             DirectoryInfo dir = new DirectoryInfo(katalogZplikamiODT);
  3.             FileInfo[] info = dir.GetFiles("*.odt");
  4.             foreach (FileInfo f in info)
  5.             {
  6.                
  7.                     string arg = String.Format(" --headless --convert-to pdf --outdir " + katalogZplikamiODT + " " + f.FullName);
  8.                     ProcessStartInfo startInfo = new ProcessStartInfo();
  9.                     startInfo.WindowStyle = ProcessWindowStyle.Normal;
  10.                     startInfo.FileName = @"C:\Program Files (x86)\LibreOffice 5\program\soffice.exe";
  11.                     startInfo.Arguments = arg;
  12.                     startInfo.UseShellExecute = true;
  13.                     process.StartInfo = startInfo;
  14.                     process.Start();
  15.                     process.WaitForExit(3000);
  16.                    
  17.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement