mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-08 17:51:20 +02:00
- Added preProcessedFIle deletion
- Removed unnecessary assignment to preProcessedFile
This commit is contained in:
parent
8759188410
commit
2189e866ab
@ -106,7 +106,7 @@ public class ConvertPDFToPDFA {
|
|||||||
Path tempInputFile = null;
|
Path tempInputFile = null;
|
||||||
byte[] fileBytes;
|
byte[] fileBytes;
|
||||||
Path loPdfPath = null; // Used for LibreOffice conversion output
|
Path loPdfPath = null; // Used for LibreOffice conversion output
|
||||||
File preProcessedFile;
|
File preProcessedFile = null;
|
||||||
int pdfaPart = 2;
|
int pdfaPart = 2;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -129,7 +129,6 @@ public class ConvertPDFToPDFA {
|
|||||||
if (!missingFonts.isEmpty() || needImgs) {
|
if (!missingFonts.isEmpty() || needImgs) {
|
||||||
// Run LibreOffice conversion to get flattened images and embedded fonts
|
// Run LibreOffice conversion to get flattened images and embedded fonts
|
||||||
loPdfPath = runLibreOfficeConversion(preProcessedFile.toPath(), pdfaPart);
|
loPdfPath = runLibreOfficeConversion(preProcessedFile.toPath(), pdfaPart);
|
||||||
preProcessedFile = loPdfPath.toFile();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fileBytes =
|
fileBytes =
|
||||||
@ -149,6 +148,9 @@ public class ConvertPDFToPDFA {
|
|||||||
if (loPdfPath != null && loPdfPath.getParent() != null) {
|
if (loPdfPath != null && loPdfPath.getParent() != null) {
|
||||||
FileUtils.deleteDirectory(loPdfPath.getParent().toFile());
|
FileUtils.deleteDirectory(loPdfPath.getParent().toFile());
|
||||||
}
|
}
|
||||||
|
if (preProcessedFile != null) {
|
||||||
|
Files.deleteIfExists(preProcessedFile.toPath());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user