Resolve wkhtml and formatting

This commit is contained in:
Anthony Stirling
2024-01-18 23:28:39 +00:00
parent 2fa68be36b
commit 75cf3ed0c1
3 changed files with 93 additions and 76 deletions

View File

@@ -63,7 +63,13 @@ public class FileToPdf {
}
pdfBytes = Files.readAllBytes(tempOutputFile);
} catch (IOException e) {
pdfBytes = Files.readAllBytes(tempOutputFile);
if (pdfBytes.length < 1) {
throw e;
}
} finally {
// Clean up temporary files
Files.delete(tempOutputFile);
Files.delete(tempInputFile);