“All” & “None” colorants and Mako
📌 Overview
The PDF Reference defines All or None with the following description:
The special colorant name All refers collectively to all colorants available on an output device, including those for the standard process colorants. When a Separation space with this colorant name is the current color space, painting operators apply tint values to all available colorants at once. This is useful for purposes such as painting registration targets in the same place on every separation. Such marks are typically painted as the last step in composing a page to ensure that they are not overwritten by subsequent painting operations.
The special colorant name None never produces any visible output. Painting operations in a Separation space with this colorant name have no effect on the current page.
The None color would seem to have little purpose, since page objects colored with it will by definition be invisible. However, they have properties that can be exploited. An example of this is to treat them as “template” objects, as a reference to position and/or size new content added to an existing PDF, possibly for VDP applications.
📗 Instructions
In Mako, these colors can be created as you would any other spot color, and the simplest way to do that is to create a DeviceN color with a single colorant. When Mako writes out a PDF, such a spot color is written as a Separation color.
You still need to define an alternate color space when defining the All or None DeviceN colors, but these are unlikely to be used. While it is possible to define an All colorant in grayscale, it would make little sense as its purpose is to paint on all separations, and a grayscale image by definition has only one.
The following example shows these activities in action to produce a single-page PDF with shapes in various colors:
⌨️ Sample Code
This code snippets below create the content above from scratch, making use of the All colorant to show how it is created, and its effect on a rendered page. For a full implementation see Visual Studio Projects/CreateColorsAndShapes, Java Projects/CreateColorsAndShapes, Python Projects/CreateColorsAndShapes.
Creating a DeviceN color
IDOMColorPtr MakeDeviceNColor(const IJawsMakoPtr& mako, const U8String& name, const CDoubleVect& representation, IDOMColorSpacePtr alternateSpace)
{
// Create a vector of colorants with one entry
auto colorants = IDOMColorSpaceDeviceN::CColorantInfoVect();
const auto colorantInfo = IDOMColorSpaceDeviceN::CColorantInfo(name, representation);
colorants.append(colorantInfo);
// Create the DeviceN space
const auto colorSpace = IDOMColorSpaceDeviceN::create(mako, colorants, alternateSpace);
// Return the new spot color
return IDOMColor::create(mako, colorSpace, 1.0, 1.0);
}
IDOMColor MakeDeviceNColor(IJawsMako mako, string name, CEDLVectDouble representation, IDOMColorSpace alternate)
{
// Create a vector of colorants with one entry
var colorants = new CEDLVectColorantInfo();
var colorant = new IDOMColorSpaceDeviceN.CColorantInfo(name, representation);
colorants.append(colorant);
// Create the DeviceN space
var colorSpace = IDOMColorSpaceDeviceN.create(mako, colorants, alternate);
// Return the new spot color
return IDOMColor.create(mako, colorSpace, 1.0, 1.0);
}
IDOMColor MakeDeviceNColor(IEDLClassFactory factory, String name, CEDLVectDouble representation, IDOMColorSpace alternate) {
// Create a vector of colorants with one entry
var colorants = new CEDLVectColorantInfo();
var colorant = new IDOMColorSpaceDeviceN.CColorantInfo(name, representation);
colorants.append(colorant);
// Create the DeviceN space
var colorSpace = IDOMColorSpaceDeviceN.create(factory, colorants, alternate);
// Return the new spot color
return IDOMColor.create(factory, colorSpace, 1.0, 1.0);
}
Creating content with an All colorant
const auto mako = IJawsMako::create();
mako->enableAllFeatures(mako);
// Create an 'All' spot color, and a brush to draw with
const auto allColor = MakeDeviceNColor(mako, "All", CDoubleVect{ 1.0, 1.0, 1.0, 1.0 }, IDOMColorSpaceDeviceCMYK::create(mako));
const auto allBrush = IDOMSolidColorBrush::create(mako, allColor);
...
// Draw a border in All
const uint32 strokeWidth = 20;
box = FRect(origin.x - strokeWidth / 2.0, origin.y - strokeWidth / 2.0, (boxSize.x * 7) + strokeWidth, boxSize.y + strokeWidth);
fixedPage->appendChild(IDOMPathNode::createStroked(mako, IDOMPathGeometry::create(mako, box), allBrush, FMatrix(),
IDOMPathGeometryPtr(), strokeWidth));
using var mako = IJawsMako.create();
IJawsMako.enableAllFeatures(mako);
// Create an 'All' spot color, and a brush to draw with
var allColor = MakeDeviceNColor(mako, "All", new CEDLVectDouble(new double[] { 1.0, 1.0, 1.0, 1.0 }), IDOMColorSpaceDeviceCMYK.create(mako));
var allBrush = IDOMSolidColorBrush.create(mako, allColor);
...
// Draw a border in All
const uint strokeWidth = 20;
box = new FRect(origin.x - strokeWidth / 2.0, origin.y - strokeWidth / 2.0, (boxSize.x * 7) + strokeWidth, boxSize.y + strokeWidth);
fixedPage.appendChild(IDOMPathNode.createStroked(mako, IDOMPathGeometry.create(mako, box), allBrush, new FMatrix(),
IDOMPathGeometry.Null(), strokeWidth));
var mako = IJawsMako.create();
IJawsMako.enableAllFeatures(mako);
var factory = mako.getFactory();
// Create an 'All' spot color, a brush to draw with
var allColor = MakeDeviceNColor(factory, "All", new CEDLVectDouble(new double[] { 1.0, 1.0, 1.0, 1.0 }), IDOMColorSpaceDeviceCMYK.create(factory));
var allBrush = IDOMSolidColorBrush.create(factory, allColor);
...
// Draw a border in All
long strokeWidth = 20;
box = new FRect(origin.getX() - strokeWidth / 2.0, origin.getY() - strokeWidth / 2.0, (boxSize.getX() * 7) + strokeWidth, boxSize.getY() + strokeWidth);
fixedPage.appendChild(IDOMPathNode.createStroked(factory, IDOMPathGeometry.create(factory, box), allBrush, new FMatrix(),
IDOMPathGeometry.Null(), strokeWidth));
🎨 Rendering examples
Using Adobe Acrobat Professional's Output Preview, we can see clearly the effect of the All colorant.
The first image shows the page created by the example code as displayed by Acrobat. The border around the colored boxes is drawn with the All colorant.
After opening the Print Preview panel, the process and spot colors are listed. Note that the All colorant is not listed with the other spot colors. Acrobat and other PDF renderers such as Mako recognize the colorant names All and None and treat them differently, as described above.

Next, we turn off the process colors and leave only the spot color on. The graphic is not shown in its color, because when Acrobat displays a single separation in this view, it shows it in grayscale. The first spot color remains, and the All colorant is also drawn on the PANTONE BLUE 072 C separation. This may seem counter-intuitive, as the All colorant is defined only in terms of CMYK. However, the PDF spec says All paints on all separations, thus the result you see here.

This final image shows the effect of showing the Cyan and Yellow plates only. When Acrobat displays more than one separation in this view, it shows them in their own color. As before, the All colorant is drawn on these separations, and mixes to produce green.

☑️ Conclusion
Understanding the use of All and None colorants in Mako is crucial for effective PDF rendering and manipulation. The All colorant allows for painting across all separations, making it ideal for registration marks, while the None colorant can be used for invisible template objects. By following the provided instructions and sample code, users can implement these colorants in their projects, enhancing their control over PDF output.
📚 Additional Resources
If you need additional help, see our API documentation for detailed information on class/method usage, or raise a support ticket via our customer portal.