Cleans temp files produced during Pdf generation

This commit is contained in:
2016-12-06 23:58:40 +01:00
parent 3c23cf0286
commit adbaa961b0

View File

@ -132,6 +132,7 @@ namespace Yavsc.Helpers
p.StartInfo.WorkingDirectory = tempdir;
p.StartInfo = new ProcessStartInfo();
p.StartInfo.UseShellExecute = false;
p.StartInfo.WorkingDirectory = tempdir;
p.StartInfo.FileName = "/usr/bin/texi2pdf";
p.StartInfo.Arguments = $"--batch --build-dir=. -o {fo.FullName} {fi.FullName}";
p.Start();
@ -142,6 +143,8 @@ namespace Yavsc.Helpers
}
}
fi.Delete();
var di = new DirectoryInfo(Path.Combine(tempdir,$"{Model.BaseFileName}.t2d"));
di.Delete(true);
}
Model.Generated = fo.Exists;
Model.GenerationErrorMessage = new HtmlString(errorMsg);