publicclassPDFGenerateSimpleExample{publicstaticvoidmain(String[] args){ObjectMapper mapper =newObjectMapper();ObjectNode payload = mapper.createObjectNode();
payload.put("html","<h1 class='header-one'>What is Lorem Ipsum?</h1> <p> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the <strong>1500s</strong>, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>");
payload.put("css","body { font-size: 14px; color: #171717; } .header-one { text-decoration: underline; }");// your Anvil API_KEYRestClient client =newRestClient(API_KEY);HttpResponse<byte[]> response = client.generatePdf(mapper.writeValueAsString(payload));Files.write(Paths.get("output/generate-html-output.pdf"), response.body());System.out.println("Fill PDF finished");}}