other changes
This commit is contained in:
parent
96e399a617
commit
5a52e3d6dd
2 changed files with 6 additions and 6 deletions
|
@ -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 a new issue