A Cheung wrote:
> Complicated yes, but is it theoretically possible with iText?  Can it 
> modify these streams and save the modifications?

Yes, it's possible, but it's a lot of work.

> Thanks, but my question is then about Colorspaces. I am trying to keep 
> the PDF small so making images of 16M colours makes it too large.

I didn't say you had to use an image if 16M colors.
You can easily use a black and white image.
You probably want to use CCITT.

> PdfContentByte p = stamper.getOverContent(1);
> p.addImage(Image.getInstance("my.tiff"), width,0,0,height,0,0)
>  
> The above code adds an image (Xi0) to my file with the Colorspace that 
> is correct.  (It isn't DeviceGray or DeviceRGB). I use the Enfocus 
> Browser to see the PDF object tree structure and this new "Xi0" image 
> has a ColorSpace array[4] and item [3] is the stream data for the 
> colorspace of 256 specific colors in use.

And Indexed Colorspace is fine too.

>  What I'd like to do is have 
> iText create this Colorspace structure for me based on an image 
> file (along with Filter/Width/BitsPerComponent) so I can replace my 
> original Im0 structure with that data (as in the sample at your URL), 
> but _without_ having to add an Xi0 to the PDF to do it since that just 
> leaves me with another image that I'd want to remove.
>  
> Possible?

Yes.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.itextpdf.com/book/
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to