Hi Everybody,
I have an issue converting images from an image panel to a pdf .I am able to convert a single image to a pdf file but not multiple images.Can anyone help me in this. Below is the code which iam using now
public void send(String fn){
BufferedImage oldimage=image;
try{
File dir;
File home = new File(System.getProperty("user.home"));
dir = new File(home,"My Documents");
if(!dir.exists()){ dir = home;}
File file = new File(dir,fn+".pdf");file.delete();
System.out.println(file.getCanonicalPath());
ImageIO.write(getImage(), "pdf", file);
}catch(Exception e){
System.out.println("9b"+getClass().getName()+"nt.send:nt"+e.getMessage());
image=oldimage;
e.printStackTrace();
}catch(OutOfMemoryError e){
System.out.println("9b"+getClass().getName()+"nt.send:nt"+e.getMessage());
image=oldimage;
}
}
Thanks,
venkat