jamesnetherton commented on code in PR #8101:
URL: https://github.com/apache/camel-quarkus/pull/8101#discussion_r2663908278
##########
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:
If it starts to get hard manually creating the PDFs via code, then I'd vote
for pushing a 'complex' PDF containing different fonts, colors, images etc.
Something that can exercise more of the PDF code paths.
--
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]