Xpdf Version 3.04.10 Released

2015 Mar 30

Welcome to Glyph & Cog's newsletter for March 2014.

Table of contents:


Multithreaded Viewer

XpdfViewer and XpdfWidget/Qt now have a new, multithreaded display engine. Complex PDF files no longer tie up the main thread, meaning that your application will be much more responsive to user input.

The new versions of XpdfViewer and XpdfWidget/Qt are drop-in upgrades. No changes to your code are needed to take advantage of the new multithreading.

We'll be sending version 3.04.10 to all licensed XpdfViewer and XpdfWidget customers shortly. As always, feel free to contact us at any time for the latest version of any licensed product.

As an added bonus, this release also includes a much-requested feature: the side-by-side page view mode, showing two pages at a time like an open book. Using this mode is as simple as:

viewer.displayMode = viewer.displaySideBySideContinuous

Object De-duplication

The latest version of XpdfSplice will automatically de-duplicate dictionary and stream objects in output PDF files. If you're working with PDF inputs that have lots of duplicated fonts or images, this can make the PDF output significantly smaller.

No additional code is needed – this feature is automatically enabled.


Converting PDF to XML

We're just finishing up a new PDF-to-XML converter called PDFdeconstruct. The output will include a description of the text, images, vector graphics, and form fields, in XML format.

PDFdeconstruct will be useful for format conversion, document analysis, and complex content extraction. It's a cross-platform command-line tool, suitable for use on servers or for batch-mode processing.

If you're interested in trying out PDFdeconstruct, please contact us at info@glyphandcog.com.


XpdfSplice and Watermark Pages

XpdfSplice's core functionality is moving pages around – splitting a large PDF file into smaller pieces, or combining smaller PDF files into a large PDF.

But XpdfSplice can also be used to apply watermarks and page templates. This can be used in many ways:

First, load the input (content) document:

contentIn = xpdfSpliceOpenInput("content.pdf");

Then load the watermark document (this would be the letterhead, stamp, etc.):

watermarkIn = xpdfSpliceOpenInput("watermark.pdf");

Create an output document:

out = xpdfSpliceOpenOutput("output.pdf", 1.7);

Set the watermark and parameters to be used:

// use page 1 of watermark.pdf as the watermark // at 100% alpha (no transparency) xpdfSpliceSetWatermark(out, watermarkIn, 1, 1.0, 0);

Copy pages from the input document, to the output document, applying the watermark:

// copy pages 1-10 from content.pdf xpdfSpliceAddPages(contentIn, 1, 10, out);

By default, the watermark is drawn first, and then the page content is drawn on top of it. This makes sense for things like letterhead.

To generate a transparent stamp on top of each page:

// draw the watermark on top of the content, with 50% transparency xpdfSpliceSetWatermark(out, watermarkIn, 1, 0.5, xpdfSpliceWatermarkOver);

The XpdfSplice manual is available on our web site.


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.