Timo Haberkern wrote:
Ok, i understood that. But i think the color values must be changed too or i'm wrong. I think there must be a conversion from rgb to cmyk values?!?

Right. I haven't created code that performs intelligent RGB -> CMYK conversion; rather, I replace specific RGB values with specific CMYK values based on decisions we've made ahead of time.


Sorry don't understand that. For what is this task?

A PDF file is a series of "objects", each of which contains instructions for how it should be rendered. At the end of the PDF is a reference table indicating the byte offset of each object.


To save space, each object can be compressed using a few different methods. To modify the object's contents, the object must be decompressed. Because decompressing an object changes its size, the reference table must be updated when the object is decompressed. A tool such as Multivalent can take care of this for you (although as I've said previously, I had problems with it when I tried it; many others have not had problems).

Once the objects have been decompressed, you can perform a search and replace operation -- BUT, because the replace operation will likely change the size of the objects, you should use a tool that rewrites the reference table.

The text you need to replace has this general syntax:

        [red value] [green value] [blue value]  rg

or

        [red value] [green value] [blue value]  RG

You'll need to replace it with:

        [cyan] [magenta] [yellow] [black] k

and:

        [cyan] [magenta] [yellow] [black] K

respectively. Note that the color values are decimals, not integers. So, 255 = 1.0, 127 = 0.5, etc.

Note, that as others have said, going to all this trouble only makes sense if you really need your code to do this. Other tools exist that can automate this process for you via a GUI, etc.

So, check if Multivalent can do this. If it can, great. If not, check for other libs -- I'm told several exist. If you decide to get your own hands dirty, while I do not have permission to give you the code, I can offer a steady supply of advice. I've had a few requests for my lib, so I'll check again and see if I can get it released, since a PDF lib isn't neither innovative or proprietary.

Ben



Timo

Also, the number on the second last line of the document should be replaced

with the number of bytes written until the occurrence of the last 'endobj'
command.



There is a number of plug-ins, that can be used from within Adobe Reader to
convert the RGB colors of a PDF document into CMYK colors.
There is a tool named QuiteABoxOfTricks that can be found at
http://www.quite.com doing this.
I am sure it is possible to setup a batch processing solution as well, in
order to create a totally automated hack solution for this lack.
PitStop server is another solution.



Regards, Dennis JD Myrén Developer Tel: (+47) 98 00 11 92 Mail: [EMAIL PROTECTED] Web: www.oslokb.no

-----Original Message-----
From: Timo Haberkern [mailto:[EMAIL PROTECTED] Sent: 21. november 2003 14:38
To: [EMAIL PROTECTED]
Subject: Re: CMYK again


Ben,



The President of my employer is a lawyer. Dunno if open-source will happen anytime soon for that lib. ;-)

Have you checked if the open-source Multivalent lib supports this type of operation? I'll try and take a gander too, but you should check and see.


I will check it next week. Thanks for the tip.

I think it should be possible to create cmyk pdf from FOP directly. So if you can't "open-source" your solution, maybe you can talk a little bit about how to do such a replacement, so that i can maybe hack something similar into FOP?

Timo


--------------------------------------------------------------------- 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]


.





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to