Overprinting is a technique commonly used by PDFs that are destined for print. When an object is not set to overprint, the downstream RIP will remove all color beneath the object (it's knocked out). This is fine for simple RIPs and jobs, since it reduces the complexity of separation generation.
It can, however, cause issues with black text. In this scenario, the black text knocks out all the background color beneath it. This means that when printed, the head alignment and registration needs to be perfect; otherwise you'll see small white borders around the text. When switching the text to overprint, the black is printed on top of the background color, removing any potential registration issues.
The image above shows two images: The top image uses overprint on the "g" character, which shows that the red background is not knocked out. The bottom image does not use overprint, resulting in a knockout of the red background.
Setting Overprint
In Mako 8.0.0, the use of "DeviceParams" properties has been deprecated and removed. Specifically, calling getProperty("DeviceParams", ...) now throws an exception. See the new discrete API methods.
Setting overprint in Mako requires use of the "DeviceParams" property. This can be set on any node, but it only applies to that specific node (and not to its children). Therefore, it makes most sense to set it on char path groups, paths and glyphs.
The "DeviceParams" property is a bitmask that toggles the application of overprint and stroking commands.
The following code shows how to set the bitmask to turn on overprint for the node.
Setting Overprint Using Simplified API methods (Mako 7.4+)
Starting from Mako version 7.4, the SDK introduces simplified methods for setting overprint directly on DOM elements like IDOMPath and IDOMGlyphs.
For IDOMPath there are:
setFillOverprints() and getFillOverprints()
setStrokeOverprints() and getStrokeOverprints()
setOverprintMode() and getOverprintMode()
setStrokeAdjust() and getStrokeAdjust()
For IDOMGlyphs, where there are only fills:
setFillOverprints() and getFillOverprints()
setOverprintMode() and getOverprintMode()
Here's an example demonstrating how to use these methods in C++ and C# for the following PDF:
CMYK_Circles 1.pdf
Before
After
C++
CPP
/* -----------------------------------------------------------------------
* <copyright file="Main.cpp" company="Global Graphics Software Ltd">
* Copyright (c) 2025 Global Graphics Software Ltd. All rights reserved.
* </copyright>
* <summary>
* This example is provided on an "as is" basis and without warranty of any kind.
* Global Graphics Software Ltd. does not warrant or make any representations
* regarding the use or results of use of this example.
* </summary>
* -----------------------------------------------------------------------
*/
#include <iostream>
#include <jawsmako/jawsmako.h>
#include <jawsmako/pdfoutput.h>
using namespace JawsMako;
using namespace EDL;
int main()
{
U8String testFilePath = R"(..\..\TestFiles\)";
try
{
const auto mako = IJawsMako::create();
mako->enableAllFeatures(mako);
const auto assembly = IInput::create(mako, eFFPDF)->open(testFilePath + "CMYK_Circles 1.pdf");
const auto document = assembly->getDocument();
for (uint32 pageIndex = 0; pageIndex < document->getNumPages(); ++pageIndex) {
IPagePtr page = document->getPage(pageIndex);
IDOMFixedPagePtr fixedPage = page->edit();
CEDLVector<IDOMNodePtr> pathNodes;
fixedPage->findChildrenOfType(eDOMPathNode, pathNodes, true);
for (auto& node : pathNodes) {
IDOMPathNodePtr path = edlobj2IDOMPathNode(node);
if (path) {
path->setFillOverprints(true);
path->setOverprintMode(true);
}
}
}
IPDFOutput::create(mako)->writeAssembly(assembly, "test.pdf");
}
catch (IError& e)
{
const String errorFormatString = getEDLErrorString(e.getErrorCode());
std::wcerr << L"Exception thrown: " << e.getErrorDescription(errorFormatString) << std::endl;
return static_cast<int>(e.getErrorCode());
}
catch (std::exception& e)
{
std::wcerr << L"std::exception thrown: " << e.what() << std::endl;
return 1;
}
return 0;
}
C#
C#
/* --------------------------------------------------------------------------------
* <copyright file="Program.cs" company="Global Graphics Software Ltd">
* Copyright (c) 2025 Global Graphics Software Ltd. All rights reserved.
* </copyright>
* <summary>
* This example is provided on an "as is" basis and without warranty of any kind.
* Global Graphics Software Ltd. does not warrant or make any representations
* regarding the use or results of use of this example.
* </summary>
* ---------------------------------------------------------------------------------
*/
using JawsMako;
namespace EncodePNGinMemory;
internal class Program
{
static int Main(string[] args)
{
var testFilepath = @"..\..\..\..\TestFiles\";
try
{
var mako = IJawsMako.create();
IJawsMako.enableAllFeatures(mako);
using var assembly = IPDFInput.create(mako).open(testFilepath + "CMYK_Circles 1.pdf");
using var document = assembly.getDocument();
for (uint pageIndex = 0; pageIndex < document.getNumPages(); ++pageIndex)
{
IPage page = document.getPage(pageIndex);
IDOMFixedPage fixedPage = page.edit();
var pathNodes = fixedPage.findChildrenOfType(eDOMNodeType.eDOMPathNode, true);
foreach (var node in pathNodes.toVector())
{
IDOMPathNode path = IDOMPathNode.fromRCObject(node);
if (path != null)
{
path.setFillOverprints(true);
path.setOverprintMode(true);
}
}
}
IPDFOutput.create(mako).writeAssembly(assembly, IOutputStream.createToFile(mako, "test.pdf"));
}
catch (MakoException e)
{
Console.WriteLine($"Exception thrown: {e.m_errorCode}: {e.m_msg}");
}
catch (Exception e)
{
Console.WriteLine($"Exception thrown: {e}");
}
return 0;
}
}
JavaScript errors detected
Please note, these errors can depend on your browser setup.
If this problem persists, please contact our support.