1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-04 15:00:14 +01: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) { 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() + "; }");