By Date: <-- -->
By Thread: <-- -->

loading images



Resending it again as it bounced back – (please see text below for my question). We are going to have 50 + images and we don’t want them to be jarred up, rather we would pass them one at a time as file object (from UI) to the iText report generation code (middle tier) and be able to use Image.getInstance(File fileobject). Please let me know.

 

Thanks

arif

 


From: Arif Abbasi [mailto:arif.abbasi (at) verizonbusiness.com]
Sent: Friday, February 02, 2007 11:59 AM
To: 'itext-questions-request (at) lists.sourceforge.net'
Subject: re: loading images

 

Hi

 

Previously, I asked this question in which my images in the jar file were not loading when using:

 

Image.getInstance("images/vblogowhite.gif");

 

Then Bruno and someone helped me and asked to use classloader, and it worked (see below) – so thanks

 

  ClassLoader cl = this.getClass().getClassLoader();

  URL vImgURL = cl.getResource("images/vblogowhite.gif");

  Image verizGif= Image.getInstance(vImgURL);

 

The problem is with the above approach, we have to package those images in our jar file, which is not desirable. The code in jar file is common and can be called from stand-alone and webapps. What we want to do is to pass the images from UI (front-end) to back-end code (in jar file) as a parameter – like a file object and then create image out of it.

 

This would have advantage of not jarring the images in the jar file (they could reside in their place in webapps) as well as allowing users to load different images for different stuff. I looked at iText api for images and there is no method like:

 

Image.getInstance (File file).

 

à There is Image.getInstance(String filename) and Image.getInstance(URL url) in API, but they would require class loader to load the images as well as packaging them in the jar file

 

We want to load the images as file from UI and pass to back-end as file object and then want to use something like

 

Image.getInstance (File file) to create images.

 

Kindly tell me if its possible and if there is a sample?

 

Thanks

arif

 

 

 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/