<aside> 🌐 https://mupdf.com/r/MuRaster

</aside>

What is MuRaster?

MuRaster is a simple piece of code that shows how you’d use MuPDF within a printer to rasterise input documents.

It’s intended as a basis for printer customers to use when evaluating or tailoring MuPDF for their devices.

Having said that it’s simple, it’s still quite powerful, with a number of easily configuration options:

In addition, it is smart enough so that if any of the above features causes it to run into memory problems, it will progressively drop back to simpler and simpler modes of operation so that we’ll still get output (just at the cost of reduced speed).

How to configure MuRaster

There are 2 places to configure MuRaster.

include/mupdf/fitz/config.h

This is the standard MuPDF configuration file. Edit this file to control the colour output possibilities, the input formats required, and the exact font set required.

source/mupdf/tools/muraster.c

This file contains a configuration section at the top. Each option in this section can be set by the integrator simply by editing the file.

Leaving the file unedited gives sane defaults.

The options are currently as follows:

MURASTER_CONFIG_RENDER_THREADS

This controls the number of rendering threads to use. Typically if you are running on a multi-threaded CPU with N cores, you’d set this to N-1 (or N-2 if background printing is enabled).