refactor(ZUGFeRDVisualizer): improve PDF visualization performance

This commit is contained in:
Mathis Mensing
2024-07-31 15:35:11 +02:00
parent 8cb37f282b
commit e2ff39e10f

View File

@@ -226,13 +226,6 @@ public class ZUGFeRDVisualizer {
} }
FileInputStream fis = new FileInputStream(xmlFilename); FileInputStream fis = new FileInputStream(xmlFilename);
try {
// TODO why are we reading the whole file here and discarding the content?
new String(Files.readAllBytes(Paths.get(xmlFilename)), StandardCharsets.UTF_8);
} catch (IOException e2) {
LOGGER.error("Failed to read file", e2);
}
ByteArrayOutputStream iaos = new ByteArrayOutputStream(); ByteArrayOutputStream iaos = new ByteArrayOutputStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -276,12 +269,11 @@ public class ZUGFeRDVisualizer {
String result = null; String result = null;
ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer();
/* remove file endings so that tests can also pass after checking /* remove file endings so that tests can also pass after checking
out from git with arbitrary options (which may include CSRF changes) out from git with arbitrary options (which may include CSRF changes)
*/ */
try { try {
result = zvi.toFOP(CIIinputFile.getAbsolutePath()); result = this.toFOP(CIIinputFile.getAbsolutePath());
} catch (FileNotFoundException | TransformerException e) { } catch (FileNotFoundException | TransformerException e) {
LOGGER.error("Failed to apply FOP", e); LOGGER.error("Failed to apply FOP", e);
} }