Yeah, sorry about that. I think the FileUtils class is one of my own,
actually (from work or I'd just give it to you). I leave it up to the
reader to write the file copy method. :)
On Tue, Oct 14, 2008 at 4:35 PM, Dane Laverty <[EMAIL PROTECTED]> wrote:
> Thanks for the hint. I tried your class with some minor modifications
> (see below -- I commented out two lines and used the Apache FileUtils,
> since I'm not sure which FileUtils class your referenced) but without
> any success. However, while playing with that, I did notice that
> untitled.bmp that IE returns is 4+ MB, as compared to 200 KB for the
> print.png that FireFox returns. I'm not sure what that means, but it
> seems odd to me that the file returned would be browser-specific.
>
> Thanks again,
>
> Dane
>
> Modified FileImageResource class:
>
> public class FileImageResource extends DynamicImageResource
> {
> private static final long serialVersionUID = 1L;
> private final String path;
>
> public FileImageResource( File file, String format )
> {
> super(format);
> this.path = file.getAbsolutePath();
> //setCacheable(true);
>
> //setLastModifiedTime(Time.valueOf(file.lastModified()));
> }
>
> protected byte[] getImageData()
> {
> try {
> return FileUtils.readFileToByteArray(new
> File(path));
> } catch (IOException ioe) {
> logger.error("Trouble reading the image file.",
> ioe);
> return null;
> }
> }
> }
>
> -----Original Message-----
> From: James Carman [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 14, 2008 12:16 PM
> To: [email protected]
> Subject: Re: Trouble printing image
>
> Try the FileImageResource class mentioned here (by me :):
>
> http://www.nabble.com/Mount-files-outside-container-td19232069.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]