I don't know if I understand your question fully, but maybe this helps:
/**
* @param name fully qualified file name, for example "logo.bmp"
* @return an itext-image read from classpath
* @throws BadElementException
* @throws IOException
* */
public static Image getImage(String name) throws BadElementException,
IOException {
ClassLoader cl = ITextHelper.class.getClassLoader();
URL url = cl.getResource(name);
if (url==null) {
throw new RuntimeException("Cannot read " + name+" from
classpath");
}
InputStream in = url.openStream();//IOException
byte []bytes=new byte[in.available()];
in.read(bytes);
in.close();
Image image=Image.getInstance(bytes);
return image;
}
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions