Xpdf Version 4.05 Released

2024 Feb 08

Welcome to Glyph & Cog's newsletter for February 2024.

Table of contents:


Xpdf 4.05 released

Glyph & Cog is pleased to announce version 4.05 of Xpdf and all of the Xpdf libraries and components.

4.05 is primarily a bug fix release. As usual, this is an incremental release. For our commercial licensees, 4.05 is a small step from the previous 4.04.06 release.

There are some new features in the open source release:


New Platforms

Our libraries are now available for FreeBSD 13 and for Windows/MinGW. Contact us for more information on either of those.

XpdfWidget/Qt is now supported on Qt 6. Those changes are included in the 4.05 release.


Multi-Pass DeviceN Rasterization

XpdfRasterizer supports DeviceN rasterization with up to 32 color channels. (The limit of 32 is due to internal architecture.) This means it can generate the four CMYK channels, plus up to 28 spot colors. Normally, all additional spot colors are converted to CMYK.

XpdfRasterizer 4.05 can handle an arbitrary number of spot color channels using multi-pass rasterization. Each pass can generate 28 spot color channels, so two passes will generate CMYK + 56 spot colors, and so on.

The code looks like this:

// get the channel information - number of spot colors, and their names pdfLoadMPDeviceNChannels(pdf, page); nChannels = pdfGetNumMPDeviceNChannels(pdf); for (i = 0; i < nChannels; ++i) { printf("channel %2d: %s\n", i, pdfGetMPDeviceNChannelName(pdf, i)); } // main loop: each pass generates CMYK + 28 spot colors i = 4; do { // select the 28 spot colors to incluide in this pass pdfResetMPDeviceNChannelList(pdf); for (j = i; j < i + 28 && j < nChannels; ++j) { pdfAddMPDeviceNChannel(pdf, pdfGetMPDeviceNChannelName(pdf, j)); } // rasterize err = pdfConvertPageToDeviceNImage(pdf, page, dpi); if (err != pdfOk) { ..... } // use the rasterized bitmaps // note: all rasterizations include CMYK as the first four channels, // so we ignore them after the first pass (they'll be identical on // every pass) for (j = (i == 4) ? 0 : 4; j < pdfGetNumDeviceNChannels(pdf); ++j) { channelName = pdfGetDeviceNChannelName(pdf, j); pdfGetDeviceNBitmap(pdf, j, 1, 0, &hdr, &bits); ..... use the bitmap ..... pdfFreeMemory(bits); } pdfClearDeviceNImage(pdf); i += 28; } while (i < nChannels);

PDFtoSVG Font Vectorization

PDFtoSVG 4.05 provides an option to vectorize all text. The generated SVG files will not contain any text elements or fonts, and will instead use vector graphics to render the text. This can be useful for workflows that can't handle fonts (or that don't always properly handle fonts).

Usage is simple:

pdftosvg -vectortext in.pdf 1 out-svg-dir

Glyph & Cog

Glyph & Cog has been a leading provider of software components for PDF manipulation since 2002.

For more information on any of the products mentioned here, see our web site:

http://www.glyphandcog.com/

or email us at info@glyphandcog.com

This newsletter is sent to all of our customers. If you don't want to receive future issues, please email info@glyphandcog.com.