Files
proostenkrant.net/Proostenkrant.NET/LatexCompiler.cs
Douwe Ravers abf812c6e9 Automated the google forms to pdf generation process. Using pdflatex command (external program).
Only the download automation has to be done. > look at FileSystemWatcher for automatically detecting downloads
2022-12-24 15:18:20 +01:00

29 lines
695 B
C#

using System.Diagnostics;
using System.IO;
namespace Proostenkrant.NET
{
internal static class LatexCompiler
{
internal static void Compile(string text)
{
File.WriteAllText(Program.c_articlePath, text);
GeneratePdf();
}
static void GeneratePdf()
{
var processInfo = new ProcessStartInfo("cmd.exe", "/c pdflatex " + Program.c_mainPath);
processInfo.WorkingDirectory = Program.c_latexPath;
processInfo.CreateNoWindow = true;
processInfo.UseShellExecute = true;
var process = Process.Start(processInfo);
process.WaitForExit();
}
}
}