|
Hello all,
I’ve been using iText since version 1.02b with great results. I’ve recently come across some problems adding images to an RTF document through a Java Servlet. I’m using the Corda Server for image generation with Tomcat 4.1.31, but I am also having problems with static images. I’ve removed parts of my RTF servlet build and have somewhat isolated the problem. In testing some different ways of adding static images a couple of inconsistent things are happening.
I can add .BMP files with Image.getInstance( filename ) and Image.getInstance( URL ), but with .PNG images, the image doesn’t get added to the RTF document ( Image.getInstance( filename ) or Image.getInstance( URL ) ) and I don’t get any errors in the stdout.log. >From reading the documentation there should be no problem adding PNG images
Here’s some of my code. The images on the web server can be seen by taking the URL and placing it in the browser. The RTF document shows the iText .BMP images, but not the .PNG images.
gif = Image.getInstance( new URL( "http://127.0.0.1/NonMedicalPrograms/ihpes/portal/images/itext.bmp" ) ); document.add( gif ); gif = Image.getInstance( new URL( "http://127.0.0.1/NonMedicalPrograms/ihpes/portal/images/HRNList.png" ) ); document.add( gif );
// These images are place in C:/WINDOWS/system32. gif = Image.getInstance( "itext.bmp" ); document.add( gif ); gif = Image.getInstance( "HRNList.png" ); document.add( gif );
I’m looking to see if the registered program that is associated with the file types in Windows may be causing the problem. BMP files are associated with the Windows Picture and Fax Viewer and PNG files are using Microsoft Photo Editor.
Thank for any help.
Brian |
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions
