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
This commit is contained in:
28
Proostenkrant.NET/LatexCompiler.cs
Normal file
28
Proostenkrant.NET/LatexCompiler.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user