Project for converting captured printer data files to PDF format
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
font2 Add missing font file May 3, 2017
.gitignore BUGFIX - BitOffset May 15, 2017
LICENSE Initial commit Mar 23, 2017
PrinterConvert.c Remove chance of error Aug 18, 2018 Updated information on LibHaru installation Dec 9, 2018
configuration.txt Initial configuration details Mar 23, 2017
dir.c Add missing dir.c file May 2, 2017


Project for converting captured dot matrix printer data files to PDF format

Initially this conversion software is taken from the beta conversion application we are creating for the Retro-Printer module ( That project is (c) RWAP Software -

Whilst the module for capturing the printer data itself is not provided, this code is provided under the GNU General Public License, as it is felt that it would be of interest and benefit for those wanting to create software for converting Epson (ESC/P and ESC/P2) dot matrix and centronics inkjet printer data files to PDF format.

It is hoped that support for PCL (and potentially ESC/POS) could also be added and this software would then provide a modern replacement for the old epsonps software -

At present, the code has basic ESC/P conversion functionality and will need some re-writing of the code to form a stand-alone module. In particular, you will need to adapt the function read_byte_from_printer() to open any input file (or stream) and fetch the next byte to be processed.

The PrinterConvert code works by creating a bitmap image in memory which is then built up as it interprets the captured printer data. Once the bitmap image for a page is completely rendered, then that is converted to a PDF (ready for printing if you wish). The software also supports the SDL code to output a copy of the page being built to the screen should you want this (look for sdlon in the code).

RWAP Software March 2017

PRE-REQUISITES You will need libpng, ImageMagick and libHARU installed on Linux.

For Debian (on the Raspberry Pi), this means running; apt-get install libpng ImageMagick

LibHaru has to be downloaded from source and compiled:

COMPILING On some versions of Linux, you will need to change the reference in line 6 to read:

#include "/usr/include/SDL/SDL.h"

To compile the program use the following command:

gcc retroprinter.c sdl-config --cflags --libs -o retroprinter -lrt -lhpdf -lpng

DISCUSSION For general discussion about the PrinterToPDF software and the Retro-Printer project which forms the basis for this conversion software, please visit the forums -