What Will I Learn?
- You will learn to add an image directly to your report using
Image reportimage = Image.getInstance("Imagename");The method .getInstance() here copies the image properties of the image you have selected into the image you are creating to be added to the report.report.add(reportimage);This then adds the new image you have created to the report, looking exactly the way the one you have selected is, because it has been copied into the new image.- You will learn to upload an image first before adding it to the report using
JFileChooser imadechooser = new JFilChooser();which opens a file chooser frame where you can select a file, and other methods that follow before finally adding the selected file to the report using previousreport.add(reportimage);which adds the image to the report.
Requirements
- Netbeans IDE
- Itext API Jar
Difficulty
- Intermediate
Description
Adding images to reports make them look better and more organised than plain text reports, therefore In this tutorial, I have explained two different ways to easily add images to your report to make them look better.
Video Tutorial
Curriculum
- Java programming tutorial with Official Hord - Java Reports with IText Library [Adding Table]
- Java programming tutorial with Official Hord - Java Reports with IText Library
Posted on Utopian.io - Rewarding Open Source Contributors