1
0
mirror of https://github.com/pdewacht/brlaser synced 2024-12-26 15:38:20 +01:00

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.
This commit is contained in:
xc-racer99 2017-05-01 12:18:22 -07:00
parent 5c5118edc1
commit 7e59e6147e
4 changed files with 8 additions and 0 deletions

View File

@ -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
}

View File

@ -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,

View File

@ -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

View File

@ -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];