Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Manual Duplex Mode (merge) #18

Merged
merged 2 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add manual duplex mode
Printer will wait on user to feed the last printed sheet back into the input tray to print on the other side; press the button to continue
  • Loading branch information
mounaiban committed Aug 23, 2022
commit 104f414d072bcd9c6e0fa7bcc422088a70d19aea
6 changes: 5 additions & 1 deletion src/canon-lbp.drv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Copyright "(C)2020 Moses Chong"
ColorModel "Gray/Grayscale" k chunky 2
Filter application/vnd.cups-raster 1 rastertocapt
*Manufacturer "Canon Inc"
Version 0.1.3
Version 0.1.4
{
Font *

Expand All @@ -25,6 +25,10 @@ Version 0.1.3
*Choice False/Disabled "<</cupsInteger0 0>>setpagedevice"
Choice True/Enabled "<</cupsInteger0 1>>setpagedevice"

Option "captManualDuplex/Manual Duplex" Boolean AnySetup 10
*Choice False/Disabled "<</cupsInteger2 0>>setpagedevice"
Choice True/Enabled "<</cupsInteger2 1>>setpagedevice"

{
*Resolution k 1 70 592 0 "600dpi/600 DPI"

Expand Down
1 change: 1 addition & 0 deletions src/paper.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void page_set_dims(struct page_dims_s *dims, const struct cups_page_header2_s *h
dims->paper_height = header->cupsHeight; //header->PageSize[1] * header->HWResolution[1] / 72;
dims->toner_save = header->cupsInteger[0];
dims->ink_k = header->cupsInteger[1];
dims->manual_duplex = header->cupsInteger[2];
dims->line_size = header->PageSize[0];
dims->num_lines = header->cupsHeight;
dims->band_size = header->cupsRowCount;
Expand Down
1 change: 1 addition & 0 deletions src/paper.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct page_dims_s {
unsigned paper_width;
unsigned paper_height;
unsigned toner_save;
unsigned manual_duplex;
unsigned ink_k;
unsigned margin_height;
unsigned margin_width;
Expand Down
4 changes: 4 additions & 0 deletions src/rastertocapt.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ static void do_print(int fd)

fprintf(stderr, "DEBUG: CAPT: rastertocapt: start page %u\n", state->ipage);
if (ops->page_prologue) {
if (cached_page->dims.manual_duplex && state->ipage > 1) {
fprintf(stderr, "DEBUG: CAPT: rastertocapt: manual duplex: press button to continue\n");
ops->wait_user(state);
}
bool ok = ops->page_prologue(state, &cached_page->dims);
if (! ok) {
fprintf(stderr, "DEBUG: CAPT: rastertocapt: can't start page\n");
Expand Down