Forum How do I...?

Add overprint attribute

radvic
Hello I am trying to get a black text on a colored background. The print agency reguires black text to have the overprint attribute, and not use a spot color. How can I do that. I would even consider extending the princexml functionality as this is somethig I really need.
mikeday
Currently Prince only supports overprint in conjunction named (spot) colors, there is no way to specify overprint for regular CMYK or RGB colors. We might be able to add support for this in a future release.
frappierer
This would be amazing.
jacobfogg
I just received a request for the same thing from one of our clients. They are basically wanting the equivalent of "Overprint [Black] Swatch at 100%" in Acrobat Pro. Which from what I can tell means overprint K 100%... but without a spot color.

Thanks!
mikeday
Right, we have added a new prince-overprint() function, so you can do something like this:
color: prince-overprint(black)

Which operating system are you running Prince on? I can prepare a new alpha version for you to try. :)
frappierer
Wow!!
Ubuntu 10.04.4 LTS 64bit
jacobfogg
Wow indeed!

Centos 6.4
mikeday
Thanks, the new Prince alpha packages are available now.
frappierer
Hey Mike,

i tried the new Alpha
"Prince alpha (2014-08-16)
Copyright 2002-2014 YesLogic Pty. Ltd."

it is not working. Check the screenshot.
Maybe i did something wrong?
  1. overprint.jpg418.9 kB
mikeday
Strange. Can you make a small PDF file with overprint and attach it here?
frappierer
Sure. File is attached.
Css for overprint is:

.formel th:nth-child(2) {
text-align: right;
color: prince-overprint(red);

}
  1. prince-overprint(red).pdf11.4 kB
frappierer
By the way. i am using pressbooks (https://github.com/pressbooks/pressbooks) for creating the pdf.
And i did not restart the server after installing the alpha over the 9.0.5. But i guess this is not necessary.
mikeday
When I load the PDF in Acrobat and select "Show overprinting" it highlights the red text, so it seems to be working. Would you prefer CMYK red? You will need to use the cmyk() function for that.
frappierer
color: prince-overprint(cmyk(1,0,0,0));

Like this?
mikeday
Yes, although cmyk(0,1,1,0) for red. :)
frappierer
Ok. it is cmyk now, but still its no overprint. The layer below should not have a white space. The spot color overprint function is working as it should (see screenshot -> Cyan_only.png) . No notch (i just translated that word, i hope it the right one), under the text. But with the new function there is.
And my acrobat is telling me, that there is no overprint.
  1. Cyan_only.png287.6 kB
  2. FullCMYK.png344.9 kB
mikeday
Hmm, I see what you mean. However, if I use Output Preview -> Color Warnings -> Show Overprinting, then it does highlight the text as being overprinted. So I'm getting mixed signals here. :)
frappierer
Cant you do it the same as you did in the spot color feature?
mikeday
Actually we are, it's simply a matter of changing the graphics state (ExtGState) with overprint enabled (/OP true) before the text or drawing operation. That's the same thing we do for spot colors.

I'm wondering if there is something else required, such as a setting on the page itself relating to how CMYK interacts with overprint, but that's just speculation at this point.
mikeday
From the PDF specification:
Note: Not all devices support overprinting. Furthermore, many PostScript printers
support it only when separations are being produced, and not for composite output.
If overprinting is not supported, the value of the overprint parameter is ignored.

Perhaps for CMYK we need to specify a non-zero overprint mode:
When colors are specified in a DeviceCMYK color space and the native color space
of the output device is also DeviceCMYK, each of the source color components
controls the corresponding device colorant directly. Ordinarily, each source color
component value replaces the value previously painted for the corresponding de-
vice colorant, no matter what the new value is; this is the default behavior, speci-
fied by overprint mode 0.

When the overprint mode is 1 (also called nonzero overprint mode), a tint value of
0.0 for a source color component leaves the corresponding component of the
previously painted color unchanged. The effect is equivalent to painting in a
DeviceN color space that includes only those components whose values are non-
zero.
mikeday
I made some more test cases and tried setting overprint mode to 1, and it does seem to make a difference in Acrobat output preview when overprinting CMYK colors. Can you take a look at opm1.pdf and see if it looks right to you?
  1. opm0.pdf18.6 kB
    overprint mode 0
  2. opm1.pdf18.6 kB
    overprint mode 1
frappierer
opm1.pdf‎ looks way better.

But the pdf is a little odd.

If i only display the cyan channel its black (why its black? it should be cyan) and "Overprint MAGENTA" and "Overprint RED" are correctly set. -> No notch (whitespace) within the cyan colored box. (Screen 1)
But the "Overprint BLACK" text is not a real "overprint".

When i add the Magenta Channel the box turns to cyan and displays the Overprint magenta and red text. (Screen 2)
Adding yellow changes nothing.
Adding the key (black) channel will display the black "Overprint BLACK" text.

You can add me on skye "martin.junicom". This might work out faster.

Regards


  1. 1.png166.6 kB
  2. 2.png225.0 kB
mikeday
If i only display the cyan channel its black (why its black? it should be cyan) and "Overprint MAGENTA" and "Overprint RED" are correctly set. -> No notch (whitespace) within the cyan colored box. (Screen 1)
But the "Overprint BLACK" text is not a real "overprint".

I think when you only display a single color channel, Acrobat will always display it in black, perhaps for maximum contrast? eg. yellow on white is harder to see. But when you display more than one color channel, it always displays them in the proper colors.

The black overprint appears to display incorrectly because in the last alpha I changed cmyk(0,0,0,K) to be equivalent to gray(K). It seems that was a mistake, or at least Acrobat doesn't like it. We can change it back in the next alpha.

I've attached an updated example PDF below, with overprint mode still 1 but with proper CMYK black this time. It displays correctly in Acrobat output preview, does it look right to you?
  1. opm2.pdf18.6 kB
    cmyk black this time
frappierer
YES! Worked as it should.

Will you release the new alpha soon? Excited to test it.

Regards
Martin
mikeday
Yes, it is available now for Ubuntu 10.04, alpha 20140819.
frappierer
Prince alpha (2014-08-19) is installed, but the "prince-overprint" function is not working at all.
tested:
prince-overprint(red);
prince-overprint(cmyk(0,1,1,0));

regards
mikeday
That's frustrating. Can you attach a simple HTML + PDF that is failing to work?
frappierer
All attached.

look for

.formel th:nth-child(2) {
text-align: right;
prince-overprint(cmyk(0,1,1,0));
}
  1. Overprint.html1.9 kB
  2. overprint.css7.4 kB
  3. overprint20140819.pdf11.7 kB
mikeday
Ah, it needs to be "color: prince-overprint(...)". Basically you can use the prince-overprint() function like a color value, wherever a color would be accepted.
frappierer
Oh i am sorry. Its was actually written on top.

lets call for Champagne. Works like a charm.

Thank you so much.
If you need a tester again, let me know.
frappierer
Can i continue working with the alpha?
And do you know when you will officially release the new feature?
mikeday
The alpha should work fine, the reason it is not a full release yet is that we may rename or adjust some features before that. There is no release deadline yet, as we still have more features to add.
mikeday
Prince 10 is available now, and includes the prince-overprint() support for RGB and CMYK colors.
twantzen
Mike,

we’re currently using Prince 9.0r5, am I right, that the prince-overprint() isn’t supported by this version? At least my tests with prince-overprint( cmyk(0,0,0,1) ) are showing no overprints.

Thanks
Tobias
mikeday
Correct, it was first added in Prince 10.