<aside> 🌐 https://ghostscript.com/r/Ghostscript-or-MuPDF

</aside>

Choosing between Ghostscript and MuPDF

Ghostscript and MuPDF are both high-quality renderers for page description languages. While there is considerable overlap in their abilities, each one is tailored for slightly different requirements. It can therefore sometimes be hard to know which one to use in a given situation.

Input languages

If you need the ability to handle Postscript input, then you must use Ghostscript.

If you need the ability to handle PCL input, then you must use GhostPCL (a PCL parser on top of the Ghostscript graphics library).

Similarly GhostXPS is an XPS parser written on top of the Ghostscript graphics library.

For the rest of this discussion we will just say “Ghostscript” when we actually mean “Ghostscript, GhostPCL and GhostXPS”; everything we say about Ghostscript applies to the others as they shares the same basic structure and devices. In other documents you may see all three of these referred to collectively as “GhostPDL”. To make matters more confusing, we have now have an actual product called “GhostPDL” that pulls the functionality from all three together into a single executable.

If you need the ability to handle EPUB or CBZ input, then you must use MuPDF.

Both MuPDF and GhostScript (and GhostPDL) can handle PDF input. MuPDF and GhostPDL can both handle XPS input, together with bitmap formats such as JPEG, PNG and TIF.

Ghostscript is distributed with Postscript “helper files” to handle JPEG, GIF, MIFF (ImageMagick format) and raw files and can be persuaded to handle other formats using this type of Postscript program.

Color Management

Both MuPDF and Ghostscript offer color managed workflows, both use ICC profiles and (by default) LCMS. The Ghostscript color management options are more extensive (refer to http://www.ghostscript.com/doc/current/GS9_Color_Management.pdf), supporting different color management for object types (text, images and vector graphics) and separations.

Output options

If you want to output high-level Postscript, PCL/XL, or XPS, or you want to output to a MS Windows printer, then you need to use Ghostscript. Both MuPDF and Ghostscript are capable of outputting to PDF, though Ghostscript’s PDF generation is more mature. Both MuPDF and Ghostscript can produce PCLm output (basically bitmaps wrapped into PDF format). Both MuPDF and Ghostscript can produce simple bitmap based PCL output too.

Printer output

As a rule of thumb, if you want printer output, you probably want to be leaning towards using Ghostscript.

If you want to output to a printer, then it is a question of whether Ghostscript or MuPDF supports your printer out of the box. Ghostscript has support for many printers that MuPDF does not, including a “uniprint” (Universal Printer) output module that allows many more printers to be supported by creating “upp” parameter files.

MuPDF does have support for some printer outputs (such as PCL and CUPS ones). If you use MuPDF and want to print to something other than a PCL printer then you are going to need to add some C code yourself.

Both MuPDF and Ghostscript can produce PWG format output (aka CUPS format, used for printing on Linux systems), but Ghostscript can handle more of the different possible output color spaces.