Modernize and secure temp file creation
This commit is contained in:
parent
68c0941666
commit
23672cd18d
1 changed files with 1 additions and 1 deletions
|
@ -54,7 +54,7 @@ public class FileToPdf {
|
||||||
|
|
||||||
if (request.getZoom() != 1.0) {
|
if (request.getZoom() != 1.0) {
|
||||||
// Create a temporary CSS file
|
// Create a temporary CSS file
|
||||||
File tempCssFile = File.createTempFile("customStyle", ".css");
|
File tempCssFile = Files.createTempFile("customStyle", ".css").toFile();
|
||||||
try (FileWriter writer = new FileWriter(tempCssFile)) {
|
try (FileWriter writer = new FileWriter(tempCssFile)) {
|
||||||
// Write the CSS rule to the file
|
// Write the CSS rule to the file
|
||||||
writer.write("body { zoom: " + request.getZoom() + "; }");
|
writer.write("body { zoom: " + request.getZoom() + "; }");
|
||||||
|
|
Loading…
Reference in a new issue