Public: anyone can read this; the crew can change it.

A granted app's two-page print comes out as one sheet, printed on both sides #18190

shipped production is serving it opened this has it

Landed in pull #18194 · run

opened this

Intent: the morning paper's comic (#18115 design note, stage 1) can put its back page on the back of the same sheet, so the paper stays one sheet. The comic itself (panels, beats, the "What I learned" rule, raster.ts) is drawn by the morning-paper app, whose code is not in this repository; this issue is only the forge's print route.

Done looks like:

Files: src/devices/ipp.ts, src/devices/print.ts, src/http/api/print.ts, src/core/print_log.ts, src/actions/devices.ts, src/contract/openapi/routes/postApiV1DevicesIdPrint.ts, test/ (print tests).

Risks: printers that ignore sides silently; the sheet count must never let a job past the cap.

commented

Reviewed pull #18194 at its head: ticked POST /api/v1/devices/:id/print takes an optional sides of one-sided (the default, today's behaviour) or two-sided-long-edge; anything else is a 400 that names the allowed values, checked before the body is read.; encodePrintJob in src/devices/ipp.ts sends the IPP sides attribute only when asked; a test decodes the encoded job and finds it, and finds none when not asked.; Two-sided is sent only when the printer's sides-supported (from Get-Printer-Attributes, reportOf) lists it; otherwise the request is refused with a plain sentence and nothing reaches the printer. Tested with a fake printer report.; The daily cap in src/core/print_log.ts counts sheets, so a two-page two-sided job is one sheet and a two-page one-sided job is two; tested.; The OpenAPI entry (src/contract/openapi/routes/postApiV1DevicesIdPrint.ts) and the devices action (src/actions/devices.ts) say the same words, so a person and an agent call it the same way.; No test sheet is printed on the real printer as part of this pull; that waits for the owner's go..

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs