1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-06-26 00:30:27 +02:00

Modernize and secure temp file creation

This commit is contained in:
pixeebot[bot] 2024-02-10 00:08:18 +00:00
parent 68c0941666
commit 23672cd18d

View File

@ -54,7 +54,7 @@ public class FileToPdf {
if (request.getZoom() != 1.0) {
// Create a temporary CSS file
File tempCssFile = File.createTempFile("customStyle", ".css");
File tempCssFile = Files.createTempFile("customStyle", ".css").toFile();
try (FileWriter writer = new FileWriter(tempCssFile)) {
// Write the CSS rule to the file
writer.write("body { zoom: " + request.getZoom() + "; }");