Fe-Ti / rastertokpsl-re

Reverse engineered Kyocera rastertokpsl filter for CUPS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the project rastertokpsl-re

Kyocera KPSL filter for CUPS licensed under the Apache License Version 2.0. See the file "LICENSE" for more information.

The reason for development is unexpected printing errors with the original driver. The problem in the non ASCII encoding of the file names for printed files.

Tasklist:

  • make it possible to build on Linux (at least on Devuan)
  • add some other ppd files
  • create a list of required packages
  • update main readme (add requirements and manual for buiding the driver)
  • improve CmakeLists (maybe not)

Requirements

To build the project you need Cmake and GCC (I haven't tested that code with Clang and other compilers). Also you need CUPS and its (development) libraries. Below there is a list of package names required for buiulding in different systems.

(Note: currently there is only one entry (for Debian and Devuan), and it's not full due to the fact that I do not have a "clean" environment, e.g. I already have compilers, cmake and other stuff)

Devuan|Debian

  • libcupsimage2-dev
  • libcups2-dev

Instructions

  1. Run cmake -B_build -H. to generate nessesary files (Note: there are cmake variables listed at the end of the section);
  2. Run cmake --build _build/ to build all cmake targets, the resulting binaries are located in bin/ subdirectory.
  3. Run ./install.sh to install PPD files and the newly built filter.

Cmake variables

Here is a table with cmake variables for use at the first step of instructions.

Variable Description Default(ON|OFF)
DEBUG Allow debugging via GDB OFF
VERBOSE Print all warnings when compiling OFF

Supported Devices

Tested

  • Kyocera FS-1060DN

Untested

  • Kyocera_FS-1020MFP
  • Kyocera_FS-1025MFP
  • Kyocera_FS-1040
  • Kyocera_FS-1120MFP
  • Kyocera_FS-1125MFP

Credits



Older README contents

FS-1020MFP

  • PPD path: /Library/Printers/PPDs/Contents/Resources/Kyocera FS-1020MFPGDI.ppd
  • Installed in the /Library/Printers/Kyocera/kpsl/rastertokpsl.app
  • Full path to the filter: /Library/Printers/Kyocera/kpsl/rastertokpsl.app/Contents/MacOS/rastertokpl

convert for russian letter in the name

Problem with utf8 simbols in the job title.

cups

Maverick 10.9.5 have cups version 1.7.2. El Capitan 10.11.4 have cups version 2.1.0 High Sierra 10.13.6 hav cups version 2.2.5

Documentation CUPS 1.7

cups web admin:631

cupsctl WebInterface=on
sudo launchctl unload -w /System/Library/LaunchDaemons/org.cups.cupsd.plist
sudo launchctl list | grep cupsd
sudo launchctl load -w /System/Library/LaunchDaemons/org.cups.cupsd.plist
sudo launchctl list | grep cupsd

Debug cups filters:

cupsctl --debug-logging
cupsctl --no-debug-logging

Print to file. Use printer/foo to convert to the printer format defined by the filters in the PPD file.

/usr/sbin/cupsfilter -p Kyocera_FS-1020MFPGDI_RE.ppd -m printer/foo data/d001.pdf -e > t.kpsl

Filter Chain debugging

Debian pages:

Dissecting and Debugging the CUPS Printing System

The cupsfilter Utility.

RasterView 1.4.1

install

./install.sh

On the El Capitan original driver not installed with error - Not found software for install.

Need copy kpsl/ to the /Library/Printers/Kyocera/. Installation with warning - printer worked!!

reverse engineering

Used CLion and IdaPro

OSX version have image symbols

Used JBIG-KIT 2.0 - link in the resources.

JBIG-KIT on github

cups filter internal

Raster API

Filter read raster stream and write pages in the stdout.

Some rewrites

Based on the existing realisation filters in the cups source: rastertohp.c and rastertoepson.c.

replace asciitounicode

Use ConvertUTF.c for UTF8 -> UTF16 conversion.

miniunit.h

miniunit.h

pdftoraster.sh rastertokpsl.sh rastertokpsl-re.sh

Direct call filters without cupsfilter. Used for developments and testing.

pdftoraster.sh - make raster file from pdf.

rastertokpsl.sh - convert raster file to the kpsl, using original filter.

rastertokpsl-re.sh - convert raster file to the kpsl? using re filter.

kpslcmp.pl

Perl script - simple check two kpsl files, skip from compare user, timestamp and title field from kpsl header.

data_kpslcmp.pl

Perl script, which generates kpsl files for all pdf files in the data directory, using original rastertokpsl and rastertokpsl-re filters and compare it.

rastertokpsl-re must be properly installed.

ToDo

kpsldump.pl - kpsl dumper.

CaBrigtness and CaContrast

Change +-100.

About

Reverse engineered Kyocera rastertokpsl filter for CUPS

License:Apache License 2.0


Languages

Language:C 94.8%Language:Shell 3.2%Language:Perl 1.1%Language:CMake 0.5%Language:Makefile 0.5%