I have a form where the user can fill in the fields with data. Thereafter, he/she shall be able to export the data as a pdf which I have written already as it can be seen below:
public void onSubmit() {
try {
ManagerModel manager = managerDao.getManager(person);
PictureModel picture = new PictureModel();
if (person.getPhotoId() != null) {
picture = new PictureModel(pictureDao.findPictureById(person.getPhotoId()));
}
getRequestCycle().setRequestTarget( new FileRequestTarget(Exporter.exportFile(person, manager, picture), person.getPdfName()));
} catch (Exception e) {
Log.warn(e);
}
now this provides me with a pdf export along with all data. i like to also create a button which allows the user to print the data which has been entered in those fields. now, that should be a print button on the form rather than requiring the user to export then print.
can someone advise how i can create this print button? should i just use the output from the pdf export then send that to the printer? if so, how do i write that in java?