import com.openhtmltopdf.pdfboxout.PdfRendererBuilder; import com.openhtmltopdf.svgsupport.BatikSVGDrawer; import org.apache.commons.lang3.StringUtils; import org.jsoup.Jsoup; import org.jsoup.helper.W3CDom; import org.jsoup.select.Elements; import org.w3c.dom.Document; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import java.awt.*; import java.io.*; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class PDFgenServiceImpl { public static byte[] renderFromXhtmlToPdf(String templateBasePath, String basePath, String html) { html = "\n" + "
\n" + "\n" + "\n" + "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy Default Name Street 3 4444 City | \n" +
" \n" +
" \n" +
" \n" +
" Lorem Ipsum AG \n" + "Lorem ipsum dolor sit amet, consetetur sadipscing elitr Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor \n" + " | \n" +
"