apupier commented on code in PR #8101:
URL: https://github.com/apache/camel-quarkus/pull/8101#discussion_r2663132789
##########
integration-tests/pdf/src/test/java/org/apache/camel/quarkus/component/pdf/it/PdfTest.java:
##########
@@ -114,6 +118,42 @@ public void merge() throws IOException {
doc.close();
}
+ @Test
+ public void mergeWithImages() throws IOException {
+ Path firstPdfPath = Files.createTempFile("firstPdf", ".pdf");
+ PDDocument firstDocument = new PDDocument();
+ firstDocument.addPage(new PDPage());
+ PDPage page = firstDocument.getPage(0);
+ InputStream imageStream =
PdfTest.class.getResourceAsStream("/blackline.png");
+ PDImageXObject pdImage =
PDImageXObject.createFromByteArray(firstDocument, imageStream.readAllBytes(),
+ "blackline png image");
+ PDPageContentStream contents = new PDPageContentStream(firstDocument,
page);
+ contents.drawImage(pdImage, 70, 250);
+ contents.close();
+ firstDocument.save(firstPdfPath.toString());
+ firstDocument.close();
Review Comment:
here, I'm wondering if it is useful to build the pdf directly or if it would
be better to push a pdf with an image directly
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]