Skip to content

Commit

Permalink
Resync with agalakhov/master (phase 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mounaiban committed Jun 26, 2022
2 parents 06b51cc + 7906e6d commit 10bdc09
Show file tree
Hide file tree
Showing 20 changed files with 554 additions and 443 deletions.
11 changes: 10 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
SUBDIRS = src tests

SUBDIRS = src
dist_doc_DATA = SPECS INSTALL.git
EXTRA_DIST = src/canon-lbp.drv ppd
nodist_data_DATA = Makefile.in

ppd: src/canon-lbp.drv
LC_ALL=C ppdc src/canon-lbp.drv -d ./ppd

clean-ppd:
-rm -rf ppd
1 change: 0 additions & 1 deletion README

This file was deleted.

22 changes: 22 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
NOTE: this project is only passively maintained since I don't own
any LBP printers anymore after moving to another country. Please
look at https://github.com/mounaiban/captdriver for more actual
version. I'm still happy to answer your questions and merge pull
requests.


This is a driver for Canon CAPT-based printers (LBP-***)
based on several reverse engineering attempts. This is
currently in an early alpha stage. Use at your own risk.

Please take a look at INSTALL.git and INSTALL files for
installation instructions.

The printer protocol documentation based on reverse engineering
is in the SPECS file. This is incomplete and probbaly has many
errors. Please help expanding it.

The file "rastertocapt" has to be installed into CUPS manually.
If you don't know how to do that, this driver is not for you. :)
Automatic installation will not be done until the driver reaches
beta stage to avoid misuse.
88 changes: 8 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,12 @@
# captdriver
# captdriver - alternative driver for Canon CAPT printers

📣 **IMPORTANT NOTE to Fellow Hackers who Have Forked This Repo** 📣

A rebase has been scheduled for this repository, in order to stay in
sync with the [Alexey's orignal repo](https://github.com/agalakhov/captdriver/commits/master)
The rebase will take place on or after **24th June, 2022** UTC.

The following changes will take place:

- [x] The history of the `master` branch as of today will be preserved in `0.1.4-original-history`
- [ ] `0.1.4.1-RE` will become the starting point for future pull request branches
- Please make pull requests to this branch while we are at version 0.1.4.
- [ ] `0.1.4.1-master` will be absorbed back into `master`. Some commits may be squashed.

Please aware of the extra `.1` on the names of the new branches. Thanks a million!

## Foreword
**Captdriver is a free (as in speech) alternative driver** for Canon
printers that can only accept the proprietary CAPT data stream format.
It aims to be a reliable and truly portable alternative driver.
It's free and open source, so you can take part in its development,
and help with expanding support, adding new features, and most importantly,
maintaining its codebase.

As Captdriver is almost completely written in C, and uses the
Common Unix Printing System (*CUPS*), it is potentially compatible
with any operating system with a working copy of CUPS, regardless of
hardware architecture.

As a bonus for users on x86-64 hardware, Captdriver eliminates the
need to install 32-bit libraries on your 64-bit operating system.

## Status
Captdriver is currently admittedly far from complete. The driver is
under active development, but updates are sporadic. For details, look
in these places:

* [Releases](https://github.com/mounaiban/captdriver/releases)
* [Issues](https://github.com/mounaiban/captdriver/issues)
* [Issues on the original repository](https://github.com/agalakhov/captdriver/issues)
* [Wiki](https://github.com/mounaiban/captdriver/wiki)

Four printer families have been successfully used with this driver:

* LBP2900/LBP2900B
* LBP3000
* LBP3010/LBP3018/LBP3050
* [LBP3100/LBP3108/LBP3150](https://github.com/agalakhov/captdriver/issues/13)

## Acknowledgements
This driver is based on the works of Rildo Pragana, Nicolas Boichat,
Alexey Galakhov, Benoit Bolsee and Vitaliy Tomin. Special thanks to
the other [contributors](https://github.com/agalakhov/captdriver/graphs/contributors)
who made this driver possible, and the folks who donated their spare
time to test and review my edits!

## Installation and Setup
This software must be manually installed. Please refer to Mounaiban's
[Captdriver Wiki for detailed instructions](https://github.com/mounaiban/captdriver/wiki/Building-and-Installing-captdriver:-A-Unified-Guide).

## Technical Information
Details of the CAPT format are documented in the `SPECS` file.
While incomplete and expected to contain errors and omissions,
help with expanding it and making corrections is greatly
appreciated. Please also check the [wiki] for detailed information
not yet added to this file.

## Disclaimers
Please use this driver at your own risk. As with any software licensed
under the *GNU General Public License 3.0*, there is NO WARRANTY.
Full terms and conditions are detailed in the file named `COPYING`.

This is unofficial software not endorsed by Canon Inc. or any of its
affiliates.

macOS is a registered trademark of Apple Inc, registered in the U.S. and other countries and regions.

Windows is a trademark of Microsoft Corporation.
printers that can only accept the proprietary CAPT communications
protocol and associated data stream formats.

[ibm]: https://www-01.ibm.com/support/docview.wss?uid=nas8N1019527 "IBM. IBM Information on Printers by Canon. IBM Support.
Reference #N1019527. Updated 2017-03-28."
Captdriver aims to be a portable and reliable driver that can extend
the service life of existing CAPT-only printers by extending support
to newer and more operating systems.

[wiki]: https://github.com/mounaiban/captdriver/wiki "Mounaiban's captdriver Wiki."
For installation instructions and technical information, please check
the [Captdriver Wiki](https://github.com/mounaiban/captdriver/wiki).
97 changes: 89 additions & 8 deletions SPECS
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@ Status bits:
11-0: 0

STATUS4
15-8: 0
7: 0
6: 1
5: Button blinking
4: 1
3:
2:
1: 0 ready, 1 stop
0: Button active

STATUS5

Expand All @@ -159,19 +168,92 @@ All 0xD0xx commands have no reply. They all are one-way.

* 0xD0A0
Page parameters. Mandatory. Issued before each page.
0-11: ? 00 00 30 2a 02 00 00 00 1f 1f 1f 1f
^^ related to page dimensions? letter=0d, A4=02
12: 00 paper type A? 00 = plain, 01 = thick
13-18: ? 11 04 00 01 01 02
19: toner saving (0 = no, 1 = yes)
20-25: ? 00 00 78 00 60 00
0-1: ? 00 00
2-3: ? 30 2a
^^ ^^ fixed vaules, differs with model:
30 2a lpb2900
?? ?? lpb3000
ba 09 lbp3010
4-7: ? 02 00 00 00
^^ related to page dimensions:
media size lpb2900 lpb3000 lpb3010
A4 (default) ?? ?? 02
A5 ?? ?? 03
B5 ?? ?? 07
Executive ?? ?? 0a
Legal ?? ?? 0c
Letter ?? ?? 0d
EnvC5 ?? ?? 15
Env10 ?? ?? 16
EnvMonarch ?? ?? 17
EnvDL ?? ?? 18
3x5 ?? ?? 40
PRC16K ?? ?? d4
8-11: 1c 1c 1c 1c
^^ toner density (black): only bits from 2 to 5 are used, other never change:
7-6: 0
5-2: exadecimal value of the blak toner density
1-0: 0 (1 for lbp3010, but also works with 0)
Toner density range changes from model to model:
0-7 lbp2900 (3 bits used)
0-7 lbp3000 (3 bits used)
0-15 lbp3010 (4 bits used)
Dafaul values:
1c lbp2900 (bits 0,1,7,8 are always 0)
?? lbp3000 (??)
1f lbp3010 (bits 0,1 are always 1, bits 7,8 are always 0)
Bytes from 9 to 11 could be used in color printers (maybe for yellow,magenta and cyan)
12: paper type, often this requires other bytes changes:
media type lpb2900 lpb3000 lpb3010
Plain 00 ?? 01
Plain L ?? ?? 08
Thick ?? ?? 04*
Thick H ?? ?? 05*
Transparency 24 ?? 24
Label ?? ?? 04*
Envelope 20 ?? 20*

media size lpb2900 lpb3000 lpb3010
A4 (default) ?? ?? ??
A5 ?? ?? 21*
B5 ?? ?? 21*
Executive ?? ?? 21*
Legal ?? ?? ??
Letter ?? ?? ??
EnvC5 ?? ?? 21*
Env10 ?? ?? 21*
EnvMonarch ?? ?? 21*
EnvDL ?? ?? 21*
3x5 ?? ?? 21*
PRC16K ?? ?? ??

*lbp3010: also set byte 13 at 11

30 ? Special Print Mode (see byte 34)
13: ? related to page size, maybe adapt to size:
11 ? default for lbp2900, in lbpp3010 used with all page size except Legal, 16k, A4, Letter
81 ? default for lbp3010, never seen in lbp2900
14-18: ? 04 00 01 01 02
19: toner saving (0 = no, 1 = yes). Unused with some model such as in lbp3010 for which toner density setting is effective.
20-21: ? 00 00
22-23: uint16_t image margin height, lower first.
24-25: uint16_t image margin width, lower first.
26-27: uint16_t image width (line size in bytes) = LINESIZE for compressor
28-29: uint16_t image height (number of lines)
30-31: uint16_t paper width (pixels = inches * 600)
32-33: uint16_t paper height (pixels = inches * 600)
-- Older printers have only 34 bytes
34-35: ? 00 00
36: 01 paper type B? 01 = plain, 02 = thick
^^ in lbp3010 is 01 with Special Print Mode
36: ? fuser mode:
media type lpb2900 lpb3000 lpb3010
Plain (default) 01 ?? 01
Plain L 01 ?? 01
Thick 01 ?? 02
Thick H 02 ?? 02
Transparency 13 ?? 13
Label ?? ?? 14
Envelope 1c ?? 1c
37-39: ? 00 00 00


Expand Down Expand Up @@ -330,4 +412,3 @@ other values are typically
L2 = -5, L3 = 4, L4 = 384, L5 = 12, LINESIZE = 592
The actual values are probably optimized for certain dithering algorithm. They
rarely change but are not constant for the printer.

7 changes: 5 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
AC_PREREQ([2.69])
AC_INIT([captdriver], [0.1.4])
AC_INIT([captdriver], [0.1.3])

AC_CONFIG_SRCDIR([src/std.h])

AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-xz tar-ustar])
AM_INIT_AUTOMAKE([1.9 no-dist-gzip dist-xz tar-ustar subdir-objects])
AM_SILENT_RULES([yes])

AC_LANG([C])
AC_PROG_CC

Expand All @@ -18,5 +20,6 @@ AC_SUBST(CUPS_LIBS)

AC_CONFIG_FILES([Makefile
src/Makefile
tests/Makefile
])
AC_OUTPUT
5 changes: 4 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ rastertocapt_SOURCES = rastertocapt.c \

rastertocapt_SOURCES += prn_lbp2900.c

AM_CFLAGS = -std=c99 -Wall -Wextra -pedantic $(CUPS_CFLAGS)
rastertocapt_LDADD = $(CUPS_LIBS)

nodist_data_DATA = Makefile.in

AM_CFLAGS = -std=c99 -Wall -Wextra -pedantic $(CUPS_CFLAGS)
Loading

0 comments on commit 10bdc09

Please sign in to comment.