Closed mailidpankaj closed 4 years ago
Sure it is possible. You just need to ensure the icon is available as GIF/JPG/PNG and than you can read it with "ImageIO" - unfortunately I don't have time to build a new example.
See https://github.com/phax/ph-pdf-layout/blob/master/src/test/java/com/helger/pdflayout4/element/image/PLImageTest.java#L61 for how to read external files.
Than you just add them into the PLTableCell
Et voila
Hi Philip,
I can see one commit is done to the codebase. I wanted to use the latest test case to integrate the image in table cell and have added the below method in the code:
public static PLTableCell createEmptyCell () { return new PLTableCell (new PLSpacerX ()); }
But, code is not built as the method is undefined in the .class file. I wanted to update the repository by changing the version in the dependency as below:
"
<artifactId>ph-pdf-layout4</artifactId>
<version>5.1.3</version>
"
I get the dependency error saying artifact is not available. I would like to know when this will be available for the use? Thanks.
Regards, Pankaj
Yes, that code is part of the next micro release. You can just use new PLTableCell (new PLSpacerX ())
directly in your code or create your own helper method. It is just "syntactic sugar".
Hi,
Can we embed the image/icon in the table that we create using PLTable?
I know PLImage API is there to create image in the PDF. My specific requirement is to embed the image as an icon in the table cell. Please let me know whether it is supported. If yes, what is the API for the same? A code snippet will be helpful. Thanks.
Regards, Pankaj