Hi. Thanks for your responses.
Sorry for not being so clear with my question.
What I am hoping to do is to have a button, which is, when pressed, will create a print screen of a container and convert them to bytes so that I can save it as a BLOB field in our database.
Simultaneously, it will open a window browser for me to be able to save the file into PDF in a chosen location.
The part in which I’m having confusion is on how I can use javax.imageio.ImageIO to turn a a Java BufferedImage into bytes for BLOB. I am able to use this function
ImageIO.write(createImage(getParentWindow(event).parent), 'jpg', baos) to create a jpg, but I am clueless on the code I should use to convert it to bytes.
Thank you in advance.