Skip to content

Updated Code; Duplex, Simplex#180

Open
QORTEC wants to merge 7 commits intopdewacht:masterfrom
Owl-Maintain:code
Open

Updated Code; Duplex, Simplex#180
QORTEC wants to merge 7 commits intopdewacht:masterfrom
Owl-Maintain:code

Conversation

@QORTEC
Copy link
Copy Markdown
Contributor

@QORTEC QORTEC commented Mar 14, 2023

Duplex, Simplex

The following code explicitly sets the duplex/simplex in PCL.

if (page_params_.duplex || page_params_.tumble) {
    fputs("\033&l2S", out_);
  } else {
    fputs("\033&l0S", out_);
  }

\033&l2S: This sets the printer to duplex printing with tumble mode.
\033&l1S: This sets the printer to duplex printing without tumble mode. (Not Used)
\033&l0S: This sets the printer to simplex (single-sided) printing.

#169 explicitly sets the printer in simplex mode (\033&l0S).
This resolves the issue of printers continuing to duplex when disabled.

QORTEC#2 adds duplex no tumble printing.

Toner Density

Owl-Maintain#12 adds toner density adjustment

1200dpi

The following code explicitly sets the 1200dpi mode.

  // brlaser.drv.in
  Option Resolution PickOne AnySetup 10
    // Choice "300dpi/300 DPI" "<</HWResolution[300 300]/cupsColorSpace 3/cupsBitsPerColor 1/cupsRowCount 0/cupsRowFeed 0/cupsRowStep 0>>setpagedevice"
    *Choice "600dpi/600 DPI" "<</HWResolution[600 600]/cupsColorSpace 3/cupsBitsPerColor 1/cupsRowCount 0/cupsRowFeed 0/cupsRowStep 0>>setpagedevice"
    Choice "1200dpi/1200 DPI" "<</HWResolution[1200 1200]/cupsColorSpace 3/cupsBitsPerColor 1/cupsRowCount 0/cupsRowFeed 0/cupsRowStep 0>>setpagedevice"
    Choice "1200x600dpi/HD1200A" "<</HWResolution[1200 1200]/cupsColorSpace 3/cupsBitsPerColor 1/cupsRowCount 0/cupsRowFeed 0/cupsRowStep 0/cupsInteger12 2>>setpagedevice"
    Choice "2400x600dpi/HD1200B" "<</HWResolution[1200 1200]/cupsColorSpace 3/cupsBitsPerColor 1/cupsRowCount 0/cupsRowFeed 0/cupsRowStep 0/cupsInteger12 1>>setpagedevice"

  // main.cc
  p.page_speed = header.cupsInteger[12];
  p.ras1200 = (p.resolution == 1200 && p.page_speed == 2);

  // job.cc
  if (page_params_.ras1200) {
    fprintf(out_, "@PJL SET RAS1200MODE = TRUE\n");
    fprintf(out_, "@PJL SET RESOLUTION = 600\n");
  } else {
    fprintf(out_, "@PJL SET RAS1200MODE = FALSE\n");
    fprintf(out_, "@PJL SET RESOLUTION = %d\n",
            page_params_.resolution);
    if (page_params_.resolution == 1200) {
      fprintf(out_, "@PJL SET PAPERFEEDSPEED = %s\n",
              page_params_.page_speed ? "FULL" : "HALF");
    }

  // PCL Section
  fprintf(out_, "\033&u%dD",
          page_params_.resolution);
  fprintf(out_, "\033*t%dR",
          page_params_.ras1200 ? 600 : page_params_.resolution);

Brother uses multiple 1200‑dpi modes across its printers:

  • 1200dpi – a true 1200 × 1200 resolution
  • HQ1200A – simulates 1200 dpi by printing at 1200 × 600
  • HQ1200B – simulates 1200 dpi by printing at 2400 × 600

Compiling

QORTEC#3 fixes building on Fedora 38;
error: 'uint8_t' was not declared in this scope
Resolves , so uint8_t undeclared issue by explicitly including cstdint in test/tempfile.h.

Owl-Maintain#43 fixes building with CMake 4.0
Compatibility with CMake < 3.5 has been removed from CMake.

Related issues

#75 1200dpi
#154 1200dpi
#210 1200dpi
#208 1200dip
#218 CMake
#100 Simplex

@knkrth
Copy link
Copy Markdown

knkrth commented Oct 8, 2024

How to copy 2 side -> 2 side layout. On the official firmware there is only 1 side -> 2 side layout option available.

@QORTEC QORTEC marked this pull request as draft October 8, 2025 22:56
@QORTEC QORTEC marked this pull request as ready for review October 14, 2025 05:58
@QORTEC QORTEC marked this pull request as draft October 19, 2025 05:13
tomjnixon and others added 7 commits October 19, 2025 16:23
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
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.
  - Both Duplex & Tumble are `&l2S`
As per the following documentation, CMake 4.0 does not allow using a
minimum CMake version below 3.5.

https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html

* Update min CMake version from 3.5 to 3.10

Co-authored-by: Yaya <github@uwu.is>

---------

Co-authored-by: DownBackDad <3554643-DownBackDad@users.noreply.gitlab.com>
Co-authored-by: QORTEC <QORTEC@users.noreply.github.com>
Co-authored-by: Yaya <github@uwu.is>
Brother uses multiple 1200‑dpi modes across its printers:
- 1200dpi – a true 1200 × 1200 resolution
- HD1200A – simulates 1200 dpi by printing at 1200 × 600
- HD1200B – simulates 1200 dpi by printing at 2400 × 600
@QORTEC QORTEC marked this pull request as ready for review October 19, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants