Move TempFile to own class
This commit is contained in:
@ -10,7 +10,7 @@ using WGneu.Helpers;
|
||||
namespace WGneu.Documents {
|
||||
public abstract class Document : IDisposable {
|
||||
|
||||
private Utils.TemporaryFile? PdfFile = null;
|
||||
private TempFile? PdfFile = null;
|
||||
|
||||
public Document(string title) {
|
||||
Title = title;
|
||||
@ -51,8 +51,8 @@ namespace WGneu.Documents {
|
||||
}
|
||||
|
||||
public async Task Generate() {
|
||||
var pdf = new Utils.TemporaryFile("pdf");
|
||||
using (var tmpHtml = new Utils.TemporaryFile("html")) {
|
||||
var pdf = new TempFile("pdf");
|
||||
using (var tmpHtml = new TempFile("html")) {
|
||||
await File.WriteAllTextAsync(tmpHtml.FilePath, await Render());
|
||||
await Pdf.Convert(tmpHtml.FilePath, pdf.FilePath);
|
||||
}
|
||||
|
Reference in New Issue
Block a user