diff --git a/backend/build.gradle b/backend/build.gradle index abd1641..b15d8ef 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -34,6 +34,7 @@ dependencies { compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' implementation 'io.github.openhtmltopdf:openhtmltopdf-pdfbox:1.1.37' + implementation 'io.github.openhtmltopdf:openhtmltopdf-svg-support:1.1.37' implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'net.codecrete.qrbill:qrbill-generator:3.4.0' diff --git a/backend/src/main/java/com/printcalculator/service/InvoicePdfRenderingService.java b/backend/src/main/java/com/printcalculator/service/InvoicePdfRenderingService.java index de1faaa..a21e59f 100644 --- a/backend/src/main/java/com/printcalculator/service/InvoicePdfRenderingService.java +++ b/backend/src/main/java/com/printcalculator/service/InvoicePdfRenderingService.java @@ -1,6 +1,7 @@ package com.printcalculator.service; import com.openhtmltopdf.pdfboxout.PdfRendererBuilder; +import com.openhtmltopdf.svgsupport.BatikSVGDrawer; import org.springframework.core.io.ClassPathResource; import org.springframework.stereotype.Service; import org.thymeleaf.TemplateEngine; @@ -34,6 +35,7 @@ public class InvoicePdfRenderingService { PdfRendererBuilder openHtmlToPdfRendererBuilder = new PdfRendererBuilder(); openHtmlToPdfRendererBuilder.useFastMode(); + openHtmlToPdfRendererBuilder.useSVGDrawer(new BatikSVGDrawer()); openHtmlToPdfRendererBuilder.withHtmlContent(renderedInvoiceHtml, classpathBaseUrlForHtmlResources); openHtmlToPdfRendererBuilder.toStream(generatedPdfByteArrayOutputStream); openHtmlToPdfRendererBuilder.run(); diff --git a/backend/src/main/resources/templates/invoice.html b/backend/src/main/resources/templates/invoice.html index b9464c8..8584971 100644 --- a/backend/src/main/resources/templates/invoice.html +++ b/backend/src/main/resources/templates/invoice.html @@ -76,9 +76,9 @@ Pagamento entro 7 giorni. Grazie. - -
- + +