diff --git a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertHtmlToPDF.java b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertHtmlToPDF.java index 9945ad2b..c7cfc196 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertHtmlToPDF.java +++ b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertHtmlToPDF.java @@ -23,8 +23,8 @@ import stirling.software.SPDF.utils.WebResponseUtils; public class ConvertHtmlToPDF { @Autowired - @Qualifier("installBookAndHtmlFormats") - private boolean installBookAndHtmlFormats; + @Qualifier("bookAndHtmlFormatsInstalled") + private boolean bookAndHtmlFormatsInstalled; @PostMapping(consumes = "multipart/form-data", value = "/html/pdf") @Operation( @@ -47,7 +47,10 @@ public class ConvertHtmlToPDF { } byte[] pdfBytes = FileToPdf.convertHtmlToPdf( - request, fileInput.getBytes(), originalFilename, installBookAndHtmlFormats); + request, + fileInput.getBytes(), + originalFilename, + bookAndHtmlFormatsInstalled); String outputFilename = originalFilename.replaceFirst("[.][^.]+$", "") diff --git a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertMarkdownToPdf.java b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertMarkdownToPdf.java index 050dd0fe..9cefe1ff 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertMarkdownToPdf.java +++ b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertMarkdownToPdf.java @@ -33,8 +33,8 @@ import stirling.software.SPDF.utils.WebResponseUtils; public class ConvertMarkdownToPdf { @Autowired - @Qualifier("htmlFormatsInstalled") - private boolean htmlFormatsInstalled; + @Qualifier("bookAndHtmlFormatsInstalled") + private boolean bookAndHtmlFormatsInstalled; @PostMapping(consumes = "multipart/form-data", value = "/markdown/pdf") @Operation( @@ -69,7 +69,10 @@ public class ConvertMarkdownToPdf { byte[] pdfBytes = FileToPdf.convertHtmlToPdf( - null, htmlContent.getBytes(), "converted.html", htmlFormatsInstalled); + null, + htmlContent.getBytes(), + "converted.html", + bookAndHtmlFormatsInstalled); String outputFilename = originalFilename.replaceFirst("[.][^.]+$", "") diff --git a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertWebsiteToPDF.java b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertWebsiteToPDF.java index 7fb4eeec..c2d25973 100644 --- a/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertWebsiteToPDF.java +++ b/src/main/java/stirling/software/SPDF/controller/api/converters/ConvertWebsiteToPDF.java @@ -29,8 +29,8 @@ import stirling.software.SPDF.utils.WebResponseUtils; public class ConvertWebsiteToPDF { @Autowired - @Qualifier("installBookAndHtmlFormats") - private boolean installBookAndHtmlFormats; + @Qualifier("bookAndHtmlFormatsInstalled") + private boolean bookAndHtmlFormatsInstalled; @PostMapping(consumes = "multipart/form-data", value = "/url/pdf") @Operation( @@ -53,7 +53,7 @@ public class ConvertWebsiteToPDF { // Prepare the OCRmyPDF command List command = new ArrayList<>(); - if (!installBookAndHtmlFormats) { + if (!bookAndHtmlFormatsInstalled) { command.add("weasyprint"); } else { command.add("wkhtmltopdf"); diff --git a/src/main/resources/settings.yml.template b/src/main/resources/settings.yml.template index 368a6a43..52a84bf4 100644 --- a/src/main/resources/settings.yml.template +++ b/src/main/resources/settings.yml.template @@ -14,7 +14,7 @@ system: googlevisibility: false # 'true' to allow Google visibility (via robots.txt), 'false' to disallow enableAlphaFunctionality: false # Set to enable functionality which might need more testing before it fully goes live (This feature might make no changes) customApplications: - installBookAndHtmlFormats: false # Installs Calibre for book format conversion (For non docker it must be manually downloaded but will need to be true to show in UI) + bookAndHtmlFormatsInstalled: false # Installs Calibre for book format conversion (For non docker it must be manually downloaded but will need to be true to show in UI) #ui: # appName: exampleAppName # Application's visible name