Re: [iText-questions] How do I convert a PDF to grayscale - followup

2008-11-26 Thread Rick Carback
Could you elaborate on that? I don't recall ever having to deal with those things when I worked on images. I just used the add function on the document object and it worked fine. Then again, I was only adding them to new documents, and not replacing an existing image. -R On Wed, Nov 26, 2008 at

Re: [iText-questions] How do I convert a PDF to grayscale - followup

2008-11-25 Thread Leonard Rosenthol
you also need to rewrite the entire Image dictionary as well with new values for colorspace, etc. Leonard On Nov 25, 2008, at 7:02 PM, Rick Carback wrote: Klas, You should be able to read the bytes and convert them. Something like this should work (written on the fly, there might be mist

Re: [iText-questions] How do I convert a PDF to grayscale - followup

2008-11-25 Thread Rick Carback
oops, forgot k++; in that for loop. -R On Tue, Nov 25, 2008 at 1:02 PM, Rick Carback <[EMAIL PROTECTED]> wrote: > Klas, > > You should be able to read the bytes and convert them. > > Something like this should work (written on the fly, there might be > mistakes): > > Image i = ... > byte[] b = i

Re: [iText-questions] How do I convert a PDF to grayscale - followup

2008-11-25 Thread Rick Carback
Klas, You should be able to read the bytes and convert them. Something like this should work (written on the fly, there might be mistakes): Image i = ... byte[] b = i.getRawData(); byte[] grayscale = new byte[b.length%3]; int k = 0; for (int j = 0; j < b.length; j+=3) { //Y = 0.3*R + 0.59*G +

[iText-questions] How do I convert a PDF to grayscale - followup

2008-11-25 Thread Klas Lindbäck
There has been no reply to my question 5 days ago on converting a PDF containing an image with RGB color to grayscale. Am I correct to assume that there is no easy way to do this using iText? Cheers, Klas - This SF.Net ema

[iText-questions] How do I convert a PDF to grayscale

2008-11-20 Thread Klas Lindbäck
I have a pdf template containing a grayscale image. The pdf is supplied from an external source and is typically created by exporting as PDF from Adobe Illustrator, inDesign or similar tool. I use iText to import the image and then add text to create a PDF which is later sent to a printing press