create new tag
view all tags


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:

  • The color output can be tuned to include any of Greyscale, RGB, CMYK, with or without halftoning.

  • Optionally uses threading (if available) to do background printing (so the next page can be being interpretted while this one is being rendered).

  • Optionally uses threading (if available) to optimise the rendering of bands.

  • Optionally can automatically spot that a page is greyscale, and will drop back to using pure greyscale rendering (saving time).

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.


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.


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:


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).


This controls whether background printing is used. Typically single threaded CPUs would disable it (set it to 0), multi-threaded CPUs might set it to 1.


Set to the devices X resolution in dpi.


Set to the devices Y resolution in dpi.


The printable page width in inches.


The printable page height in inches.


The maximum size to use for the fz_store. Typically, set this to the amount of memory free for MuRaster to work with.


The smallest band height we can ever use. On an inkjet printer this would typically be the number of lines printable with one pass of the nozzles.


The amount of memory to use for each rendering threads render buffer.


Whether to attempt "grey page detection" or not.

-- Robin Watts - 2016-11-22


Topic revision: r1 - 2016-11-22 - RobinWatts
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 2014 Artifex Software Inc