Browse Source

Add duplex code for DCP-7065DN

The official Brother driver treats Tumble and NoTumble differently, adding &l2S and &l1S respectively to the header.

Unfortunately, for me this resulted in missing lines in NoTumble.  By treating everything as Tumble and simply sending data rotated 180 for Tumble we get a good quality printout.
pull/17/head
xc-racer99 9 years ago
parent
commit
7e59e6147e
  1. 1
      brlaser.drv.in
  2. 4
      src/job.cc
  3. 2
      src/job.h
  4. 1
      src/main.cc

1
brlaser.drv.in

@ -94,4 +94,5 @@ Option "brlaserEconomode/Toner save mode" Boolean AnySetup 10
Attribute "NickName" "" "Brother DCP-7065DN, using @PACKAGE@ v@VERSION@"
Attribute "1284DeviceID" "" "MFG:Brother;CMD:PJL,HBP;MDL:DCP-7065DN;CLS:PRINTER;CID:Brother Laser Type1;"
PCFileName "br7065dn.ppd"
Duplex rotated
}

4
src/job.cc

@ -76,6 +76,10 @@ void job::write_page_header() {
fputs("\033E", out_);
fprintf(out_, "\033&l%dX", std::max(1, page_params_.num_copies));
if (page_params_.duplex) {
fputs("\033&l2S", out_);
}
}
void job::encode_page(const page_params &page_params,

2
src/job.h

@ -25,6 +25,7 @@
struct page_params {
int num_copies;
int resolution;
bool duplex;
bool economode;
std::string sourcetray;
std::string mediatype;
@ -33,6 +34,7 @@ struct page_params {
bool operator==(const page_params &o) const {
return num_copies == o.num_copies
&& resolution == o.resolution
&& duplex == o.duplex
&& economode == o.economode
&& sourcetray == o.sourcetray
&& mediatype == o.mediatype

1
src/main.cc

@ -111,6 +111,7 @@ page_params build_page_params() {
p.resolution = header.HWResolution[0];
p.economode = header.cupsInteger[10];
p.mediatype = header.MediaType;
p.duplex = header.Duplex;
if (header.MediaPosition < sources.size())
p.sourcetray = sources[header.MediaPosition];

Loading…
Cancel
Save