It's entirely possible that you are changing it yourself.

The colormodel that the RasterImage returns may be affecting your output.

Try using iText's default Image.getInstance("imagePath");
constructor to test if this is the case.

Let me know
Bill

-----Original Message-----
From: Menke, John [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 1:52 PM
To: 'Bill Ensley'
Subject: RE: [iText-questions] howto stop grayscale jpg lightening
automatically on output to pd f?


could i be changing the bytes myself without realizing it?

i use blow to get a RenderedImage from a SeekableStream created from the
JPEG :

private RenderedImage createRenderedImageFromJPEGStream(SeekableStream
inputStream)
                throws IOException {

                ImageDecoder decoder =
                        ImageCodec.createImageDecoder(
                                "jpeg",
                                inputStream,
                                ((ImageDecodeParam) new JPEGDecodeParam()));

                RenderedImage jpegImage = decoder.decodeAsRenderedImage(0);

                return jpegImage;
}



after that i create an Itext Image from the the RenderedImage:

Raster ra = ri.getData();
BufferedImage bi =
        new BufferedImage(
                ri.getColorModel(),
                Raster.createWritableRaster(
                ri.getSampleModel(),
                ra.getDataBuffer(),
                null),
                false,
                new Hashtable());
Image img = Image.getInstance(bi, null, true);


THIS SHOULD NOT BE ALTERING THE BYTES RIGHT?






-----Original Message-----
From: Bill Ensley [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 3:16 PM
To: Menke, John
Subject: RE: [iText-questions] howto stop grayscale jpg lightening
automatically on output to pd f?


If I understand correctly, iText just dumps the jpeg data into the PDF file.
It does'nt adjust the jpeg, Acrobat must be doing that.

Try creating a java image and passing the bytes to iText instead and see if
that works.

Hope this helps
Bill Ensley
Bear Printing

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Menke,
John
Sent: Wednesday, March 24, 2004 11:49 AM
To: '[EMAIL PROTECTED]'
Subject: [iText-questions] howto stop grayscale jpg lightening
automatically on output to pd f?


i have a grayscale jpg image that appears in all image viewers i have with a
dark gray background.  when i output the image to pdf it appears as if itext
is automatically adjusting the colors on the page so that this dark gray is
white and other darker spots on the image are lightened by the same
amount...is there a way to turn this off??



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to