From d209bac4c195f15aa382ea0d16c944413e3dcff3 Mon Sep 17 00:00:00 2001 From: Thomas Nixon Date: Sun, 23 Oct 2022 11:09:09 +0100 Subject: [PATCH 1/4] explicitly disable duplex in PCL this seems to be required for the HL-L2350DW, and matches the behaviour of the official driver without this, if duplex is disabled then the printer still duplexes, but every other page is garbled --- src/job.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/job.cc b/src/job.cc index 9212e65..fa6fb43 100644 --- a/src/job.cc +++ b/src/job.cc @@ -80,6 +80,8 @@ void job::write_page_header() { if (page_params_.duplex) { fputs("\033&l2S", out_); + } else { + fputs("\033&l0S", out_); } } From b93c4adf0c9573e8e94252f2e7f6f2675c7a557e Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Sun, 15 Jan 2023 10:54:23 -0500 Subject: [PATCH 2/4] Tumble support --- src/job.cc | 4 +++- src/job.h | 2 ++ src/main.cc | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/job.cc b/src/job.cc index fa6fb43..3321ab9 100644 --- a/src/job.cc +++ b/src/job.cc @@ -78,8 +78,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) { + if (page_params_.duplex && page_params_.tumble) { fputs("\033&l2S", out_); + } else if (page_params_.duplex) { + fputs("\033&l1S", out_); } else { fputs("\033&l0S", out_); } diff --git a/src/job.h b/src/job.h index bd7a83b..0c0442c 100644 --- a/src/job.h +++ b/src/job.h @@ -27,6 +27,7 @@ struct page_params { int num_copies; int resolution; bool duplex; + bool tumble; bool economode; std::string sourcetray; std::string mediatype; @@ -36,6 +37,7 @@ struct page_params { return num_copies == o.num_copies && resolution == o.resolution && duplex == o.duplex + && tumble == o.tumble && economode == o.economode && sourcetray == o.sourcetray && mediatype == o.mediatype diff --git a/src/main.cc b/src/main.cc index d6232b4..abe0528 100644 --- a/src/main.cc +++ b/src/main.cc @@ -111,6 +111,7 @@ page_params build_page_params(const cups_page_header2_t &header) { p.economode = header.cupsInteger[10]; p.mediatype = header.MediaType; p.duplex = header.Duplex; + p.tumble = header.Tumble; if (header.MediaPosition < sources.size()) p.sourcetray = sources[header.MediaPosition]; From 911a518f4e019adacebe4b447467231c0bd08bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Sat, 2 Apr 2022 23:38:34 +0200 Subject: [PATCH 3/4] fix build under Fedora 38 Building brlaser under Fedora 38 gives the following error in test/tempfile.h: error: 'uint8_t' was not declared in this scope This commit fixes it by explicitly including `cstdin` in the file, so `uint8_t` is correctly defined there. --- test/tempfile.h | 1 + 1 file changed, 1 insertion(+) diff --git a/test/tempfile.h b/test/tempfile.h index 75feb6c..6441e9a 100644 --- a/test/tempfile.h +++ b/test/tempfile.h @@ -21,6 +21,7 @@ #include #include #include +#include #include class tempfile { From f277899eecf82fe898086e80999b5513f7c8d825 Mon Sep 17 00:00:00 2001 From: Benjamin Lowell Date: Fri, 10 Jan 2025 17:32:12 -0500 Subject: [PATCH 4/4] Bug Owl-Maintain#23 Corrected the Duplex & Tumble Check: - swapped the PLC values for duplex and tumble. Thanks @wmlapierre --- src/job.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/job.cc b/src/job.cc index 3321ab9..833c557 100644 --- a/src/job.cc +++ b/src/job.cc @@ -78,9 +78,9 @@ void job::write_page_header() { fputs("\033E", out_); fprintf(out_, "\033&l%dX", std::max(1, page_params_.num_copies)); - if (page_params_.duplex && page_params_.tumble) { + if (page_params_.duplex) { fputs("\033&l2S", out_); - } else if (page_params_.duplex) { + } else if (page_params_.tumble) { fputs("\033&l1S", out_); } else { fputs("\033&l0S", out_);