Hi all,
by default XMPie uDirect is printing 2d barcodes only in black and they are defined in RGB.
XMPie generates an EPS (Encapsulated PostScript) for the 2d barcodes.
If you want to print the barcodes in color you have to change the RGB values in the PostScript code using QLingo.
Consider a function that creates a 2D barcode printing in black:
XMP2DQRCode("barcode-test")
Now you can use the FindAndReplace() function to replace all PostScript commands for the RGB values.
FindAndReplace(XMP2DQRCode("barcode-test"), "0.00 0.00 0.00 setrgbcolor", "1.00 0.00 0.00 setrgbcolor")
This results in a RGB-red colored code.
The first RGB value is Red, the 2nd Green, the 3rd is Blue.
0.00 = 0% and 0.50=50% and 1.0 = 100% halftone.
All RGB values = 0 results in black and all RGB values = 1.00 results in white.
For changing the RGB to CMYK color space try this:
FindAndReplace(FindAndReplace(XMP2DQRCode("barcode-test"), "0.00 0.00 0.00 setrgbcolor", "0.00 1.00 1.00 0.00 setcmykcolor"),"1.00 1.00 1.00 setrgbcolor","0.00 0.00 0.00 0.00
setcmykcolor")
This results in a CMYK-red colored code.
The first CMYK value is Cyan, the 2nd is Magenta, the 3rd is Yellow, the 4th is Black. 0.00 = 0% and 0.50=50% and 1.0 = 100% halftone.
Setting the 2d barcode into spotcolor try this (here the name of Spotcolor is: "Red Spot")
FindAndReplace(FindAndReplace(FindAndReplace(XMP2DQRCode("barcode-test"), "0.00 0.00 0.00 setrgbcolor", "MySpot 1.0 setcustomcolor"), "1.00 1.00 1.00 setrgbcolor", "0.00 0.00 0.00 0.00 setcmykcolor"), "%%EndComments", "%%EndComments\r 0 1 0.8 0 (Red Spot)\r findcmykcustomcolor\r /MySpot exch def")
"0 1 0.8 0 (Red Spot)" results in a red color defined by CMYK custom values
"MySpot 1.0 setcustomcolor" is setting the spotcolor to 100% halftone
In the color palette of Indesign the name of spotcolor will appear with the following (same code like above with some additionals in header section):
FindAndReplace(FindAndReplace(FindAndReplace(XMP2DQRCode("barcode-test"), "0.00 0.00 0.00 setrgbcolor", "MySpot 1.0 setcustomcolor"), "1.00 1.00 1.00 setrgbcolor", "0.00 0.00 0.00 0.00 setcmykcolor"), "%%EndComments", "%%DocumentCustomColors: (Red Spot) \r%%CMYKCustomColor: 0 1.0 0.8 0 (Red Spot) %%EndComments\r 0 1 0.8 0 (Red Spot)\r findcmykcustomcolor\r /MySpot exch def")
For coloring in Duplex mode try this:
FindAndReplace(FindAndReplace(XMP2DQRCode("barcode-test"), "0.00 0.00 0.00 setrgbcolor", "[ /DeviceN [ (Red Spot) (Black) ] /DeviceCMYK { exch 0 exch dup 0.8 mul 4 3 roll } bind ] setcolorspace 0.6 0.2 setcolor"), "1.00 1.00 1.00 setrgbcolor", "0.00 0.00 0.00 0.00 setcmykcolor")
"(Red Spot) (Black)" defines the duplex tone composed by the spotcolor and one of the CMYK color
"0.6 0.2 setcolor" defines the halftone of the spotcolor and the CMYK color.
All information supplied without guarantee!
Have fun.
Regards
Yosimo