Merge pull request #438 from matmen/visualization-performance

refactor(ZUGFeRDVisualizer): improve PDF visualization performance
This commit is contained in:
Jochen Staerk
2024-08-08 14:10:10 +02:00
committed by GitHub

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);
} }