mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2024-11-16 12:20:12 +01:00
other changes
This commit is contained in:
parent
96e399a617
commit
5a52e3d6dd
@ -23,8 +23,8 @@ import stirling.software.SPDF.utils.WebResponseUtils;
|
|||||||
public class ConvertHtmlToPDF {
|
public class ConvertHtmlToPDF {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Qualifier("htmlFormatsInstalled")
|
@Qualifier("installBookAndHtmlFormats")
|
||||||
private boolean htmlFormatsInstalled;
|
private boolean installBookAndHtmlFormats;
|
||||||
|
|
||||||
@PostMapping(consumes = "multipart/form-data", value = "/html/pdf")
|
@PostMapping(consumes = "multipart/form-data", value = "/html/pdf")
|
||||||
@Operation(
|
@Operation(
|
||||||
@ -47,7 +47,7 @@ public class ConvertHtmlToPDF {
|
|||||||
}
|
}
|
||||||
byte[] pdfBytes =
|
byte[] pdfBytes =
|
||||||
FileToPdf.convertHtmlToPdf(
|
FileToPdf.convertHtmlToPdf(
|
||||||
request, fileInput.getBytes(), originalFilename, htmlFormatsInstalled);
|
request, fileInput.getBytes(), originalFilename, installBookAndHtmlFormats);
|
||||||
|
|
||||||
String outputFilename =
|
String outputFilename =
|
||||||
originalFilename.replaceFirst("[.][^.]+$", "")
|
originalFilename.replaceFirst("[.][^.]+$", "")
|
||||||
|
@ -29,8 +29,8 @@ import stirling.software.SPDF.utils.WebResponseUtils;
|
|||||||
public class ConvertWebsiteToPDF {
|
public class ConvertWebsiteToPDF {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@Qualifier("htmlFormatsInstalled")
|
@Qualifier("installBookAndHtmlFormats")
|
||||||
private boolean htmlFormatsInstalled;
|
private boolean installBookAndHtmlFormats;
|
||||||
|
|
||||||
@PostMapping(consumes = "multipart/form-data", value = "/url/pdf")
|
@PostMapping(consumes = "multipart/form-data", value = "/url/pdf")
|
||||||
@Operation(
|
@Operation(
|
||||||
@ -53,7 +53,7 @@ public class ConvertWebsiteToPDF {
|
|||||||
|
|
||||||
// Prepare the OCRmyPDF command
|
// Prepare the OCRmyPDF command
|
||||||
List<String> command = new ArrayList<>();
|
List<String> command = new ArrayList<>();
|
||||||
if (!htmlFormatsInstalled) {
|
if (!installBookAndHtmlFormats) {
|
||||||
command.add("weasyprint");
|
command.add("weasyprint");
|
||||||
} else {
|
} else {
|
||||||
command.add("wkhtmltopdf");
|
command.add("wkhtmltopdf");
|
||||||
|
Loading…
Reference in New Issue
Block a user