Không có mô tả

dengjia 2d72f8e527 copy & test alice.xhtml from flyingsauce example in UnitTest 6 tháng trước cách đây
core 2d72f8e527 copy & test alice.xhtml from flyingsauce example in UnitTest 6 tháng trước cách đây
example-app d4a6bf9e72 Initial commit 7 năm trước cách đây
.gitignore 2d72f8e527 copy & test alice.xhtml from flyingsauce example in UnitTest 6 tháng trước cách đây
README.md d4a6bf9e72 Initial commit 7 năm trước cách đây
mvnw d4a6bf9e72 Initial commit 7 năm trước cách đây
mvnw.cmd d4a6bf9e72 Initial commit 7 năm trước cách đây
pom.xml 2d72f8e527 copy & test alice.xhtml from flyingsauce example in UnitTest 6 tháng trước cách đây

README.md

pdfGenerator

An spring boot library for generating PDF files from an Xhtml file. This library also provide an mustache's template motor to dynamically generate pdf. This library use flying saucer for the pdf generation and the .

USAGE

Pdf Generator Builder

pdfgenerator is automatically added to spring configuration. The main class is an Builder to specifying template parameters. Inject directly this instance like this :

    @Autowired
    private PdfGeneratorBuilder pdfGeneratorBuilder;

Simple example - Generation from String template

this is an simple example of generation :

     Generator generator = pdfGeneratorBuilder
                    .create()
                    .withXhtml("<html><body>the universal response is {{response}}.</body></html>")
                    .build();
     Map<String, Object> data = new HashMap<>();
     data.put("response", "42");
     byte[] pdfBuffer =  generator.toBytes(data);