Created Date: 03 Feb, 2022 11:08
Last Modifed Date: 03 Feb, 2022 11:08
Mako 6.4.0 is a full product release that introduces some new and improved features, as well as fixes for identifiable support issues, labeled MAKOSUP-XXXXX.
New features include:
- support for importing Adobe Photoshop documents (.PSD)
- Windows 11 is now officially supported
- new, faster APIs for splitting and merging PDFs, targeting high page count operations (for example splitting a 100,000-page PDF into two 50,000-page PDFs)
- ability to encrypt a PDF using a private key certificate as the encryption key
- improved support for DeviceLink ICC profiles when color converting
- support for PDF/A-2u
New or improved features
Add support for Adobe Photoshop PSD image format
This new feature meets a customer requirement to read Photoshop images directly into Mako without the need for intermediate conversion to an existing supported image format, such as TIFF, JPEG, or PNG.
The new input class works in the same way as other image decoders; for example, this code snippet loads a Photoshop file into an IDOMImage:
Not shown here is a third parameter,
Gray, RGB, and CMYK colorspaces, with or without an alpha channel, are supported. Bit depths of 8-, 16-, & 32-bit are supported. Indexed color is supported.
Duotone, multi-channel images and Photoshop’s PSB (large image format) are not supported. Attempting to load these throws a “not supported” exception.
This implementation does not include an image encoder, meaning it is not possible to save an image from Mako to a Photoshop file.
A new example, imageconverter, shows the new class in action. You can find it in the MakoApps folder of the Mako distribution.
Image converter example
A new example is added to the MakoApps folder (of the Mako distribution) that shows how to convert from one image type to another. It is the first example that demonstrates use of the Photoshop image input API introduced in this release of Mako.
Improve Split and Merge performance for PDF
Mako 6.4.0 introduces two new classes,
For example, the following code combines all the PDF files found in the source folder ("test100"):
The important characteristic of these new APIs is their speed. Compared to Mako DOM-based splitting and merging, which essentially work by copying pages individually, these new methods operate in a radically different way. This is particularly evident for high page count operations, for example splitting a 200,000-page PDF into two 100,000-page PDFs. A DOM-based splitter may take several minutes to complete the task, whereas code based on these new APIs is able to carry out the task in seconds.
Better ToUnicode handling for simple fonts
This work began with a customer case to improve Unicode recovery, the process whereby downstream consumers of a Mako-processed PDF can extract meaningful content from text presented on the page.
The success of this effort led to support for PDF/A-2u. See MAKO-3757 below.
Add support for PDF/A-2u
The PDF Association describes PDF/A-2u thus: “New to PDF/A-2 is the conformance level PDF/A-2u (“u” for “Unicode”). It simplifies the text searching and copying of Unicode text for PDF documents.”
As Mako is already engineered to emit Unicode as much as possible, using a variety of techniques to identify the correct Unicode character encoding when the information is missing in the source, it was straightforward to combine this with the existing support for PDF/A to add the capability for writing PDFs to meet this standard.
To make use of it, simply set the PDF version of the
A quick way to give this new output a try is to use the standard Mako example,
Add APIs to IDistiller to match Jaws PDFLib more closely
IDistiller, Mako’s class for direct PostScript to PDF conversion, now offers additional conversion parameters, governing such things as image downsampling, overprint simulation, linearization, thumbnail generation, and more.
The online documentation for this and the makodistiller sample have been updated to reflect the improvements in this release. You can find them here:
Support device link profiles when converting colors using IColorManager
MAKOSUP-10862 Encrypt a PDF using a digital certificate
This development meets a customer requirement to enable certificate-based public key encryption for output. Decryption at input is also implemented.
Input A new API,
Output A new overload for the API
A code example is available.
Create new builds of Mako for RHEL7 and RHEL8
Two new Linux distributions are added to the Mako distribution:
Improve streaming for C# & Java developers
Improvements are made internally to hide the SWIG-generated class names, thereby making the streaming classes more palatable to C# and Java developers. However, the main effort is the development of new example code that implements helper classes that show how to use the random-access streaming callback mechanism.
Embedded fonts are duplicated in the output of a combine operation
When combining PDFs with a Mako-based utility, the same font appeared to be embedded more than once. This is counter to the normal behavior that sees Mako merge fonts and font subsets when writing to PDF.
This change improves the generation of CID fonts (the example was Japanese) that prevents the font duplication in the PDF output.
Ensure that non-random-access streams work with IDOMFontOpenType
During testing of Mako sample code, an error was encountered when attempting to load a font from a fixed stream. Although the Mako API allowed it, internally OpenType fonts can't work unless the stream is seekable. To solve this, a convenience API is added to convert a fixed stream to random access by making a temporary copy.
The new API returns an
Mako calls this automatically as required, meaning that user code need not be amended.
Speed up IJPDS stitching performance
We have continued to develop the IJPDS direct-to-raster feature that was introduced in Mako 6.3.0. Its purpose is to retrieve a page raster from an IJPDS input as quickly as possible, when the primary intent is to send the raster on to an output device.
Testing demonstrates the following improvements:
For these tests, output is to raster without writing to disk.
Stop using exceptions for flow control when writing to our outputs
When Mako writes to outputs, most do so while avoiding calling
To avoid this, the outputs only attempt to request the next page and the next document to allow for efficient consumption and lower memory use. To do this, they call
While this mechanism works very well, it has resulted in queries to the support list from developers working with Mako who are concerned that something is awry.
The solution is to add two new public APIs:
The writing loops for PS, PDF, PXL, and PCL output have been updated to use the new APIs, preventing the confusing exceptions seen previously.
Objects missing on output using -separate option for fts_38xx.xps
A rendering issue observed during routine testing has been fixed in this release.
There is no actionable information when Mako initialization fails due to the default cache directory not being suitable
When Mako is initialized in an environment where the process doesn't have permission to write to the default cache directory, an undefined error is thrown.
To make it easier for developers to track down this easily rectified error, a more meaningful message is passed when this exception is thrown, for example:
Java SWIG distributions are missing example source code for simplexamples and others
It was noted that the C# distribution included source for the various examples that are included with Mako, but that they were missing from the Java distribution. This is now rectified.
This section describes improvements made to Mako in response to support requests.
MAKOSUP-10759 getPageText from IPageLayout returns text runs that are joined in wrong order
MAKOSUP-10785 Mako returns swapped mediabox for some PCL5 documents?
An improvement is made to the IPCL5Input class to improve interpretation of page orientation so that the page, when converted to PDF and viewed, appears in the correct orientation for reading.
MAKOSUP-10806 Problem with Unicode in ink name?
This issue is caused by ink names found in a PDF that are not encoded with Unicode (that is, the recommendation in the PDF specification for strings of this nature). Unfortunately, not all tools adhere to this convention. Some use
Mako now first converts to UTF-8; if this fails, it tries
MAKOSUP-10815 Some space characters not extracted
MAKOSUP-10839 Missing objects rendering a file
A mismatch between a narrow page element and a clipping path led to an object being dropped from rasterized output. Now fixed.
MAKOSUP-10841 MakoConverter removing bold fonts on PDF documents
The cause of this problem is conflicting information in the
Mako now ignores
An environment variable is added that restores previous behavior should it be required:
It can be set to anything; its presence is what matters.
MAKOSUP-10842 Font encoding error in imported pdf
The customer case uses a
Mako now uses a different approach to deal with this situation, improving the output and matching that of Acrobat.
MAKOSUP-10843 Exception in IJawsRenderer::renderSeparations()
Improvement to Mako’s custom transform implementation to deal with the customer case was required. Now fixed.
MAKOSUP-10850 Retrieve ICC profile name - can it be made clearer?
A Mako customer was understandably confused by this. For example, it’s possible to retrieve information about an ICC profile (such as the version, component names) from APIs in
To improve this situation, convenience APIs are added that internally call the
MAKOSUP-10851 MAKO 6.3.0 Error when compiling with MUSL library
A library added in Mako 6.3.0 (libjpeg-turbo) was exporting symbols that clashed with a customer’s project. Now fixed.
MAKOSUP-10856 JawsMako.Separator not available
MAKOSUP-10872 Missing font triggers Internal RIP Error
The customer exhibit is a badly broken PDF. It contains a font reference (
The bad font reference appears in text added as a watermark to indicate the licensing status of the host application.
Mako now renders this text, but the change carries risk, as several assumptions must be made about the missing font. Therefore, support for this must be enabled by setting an environment variable:
It can be set to anything; its presence is what matters.
MAKOSUP-10873 Support template form of createInstance<IDOMPathGeometryBuilder>()
The definition of this API was incorrect and preventing creation of an
MAKOSUP-10874 Provide an API to definitively indicate if a font is subsetted
There are two requirements:
Although it is possible to infer that a font is subsetted by examining the font name (as by convention, a subsetted font’s
A new API,
For the second requirement, Mako now prepends a tag (as described above) to preserve the indication that the font is actually a subset, during PDF output.
MAKO Version 6.4.0 is built for the following platforms:
- Linux (for Debian-based distributions; for example, Ubuntu, Mint)
- Linux (Centos)
- Linux (Red Hat Enterprise v7.0)
- Linux (Red Hat Enterprise v8.4)
- Linux (for Debian Buster) (ARM32 for Raspberry Pi)
- Linux (for Debian Stretch)
- Linux (for Debian Bullseye)
- Linux (for MUSL distributions; for example, Alpine Linux)
- Linux (for Ubuntu 20.04 LTS)
- Windows (static and dynamic libs, VS 2019 (V142), x86 and x64)
- Windows (static and dynamic libs, VS 2017 (V141), x64)
The Android build has been dropped from this release pending a tooling change. Please contact Mako support if you need a Mako release for Android later than Mako 6.1.0.
Mako supports the following programming languages:
- C++ (Mako is written in C++)
- C# (.Net Framework and .Net Core)
- Java (built with OpenJDK11)
- Python (v3.8)
The alternatives to C++ are built using SWIG (www.swig.org), which provides a translation to the native libraries found in these distribution folders: