Registry / Framework

framework · v0.1.2
Print Imposition
Complete paired front and back impressions before counting a duplex sheet as finished.
Use Print Imposition
use vendor::print_imposition::print_imposition;
Run the example
nest demo print_imposition@0.1.2
blyxc native-run print_imposition-demo/main.blyx
Example source and expected output
use std::cli;
use std::text;
use vendor::print_imposition::print_imposition;
fn main() {
let arguments = cli_args();
if args_len(arguments) > 0 {
if args_len(arguments) % 2 != 0 {
stderr_line("Expected event and value pairs");
process_exit(2);
}
let mut live = print_imposition_start();
let mut i = 0;
while i < args_len(arguments) {
let input = args_at(arguments, i + 1);
if !text_is_number(input) {
stderr_line("Expected a whole numeric event value");
process_exit(2);
}
live = print_imposition_step(live, args_at(arguments, i), text_number(input));
let command = print_imposition_command(live);
println!(command);
if command == "reject" { process_exit(1); }
i += 2;
}
return;
}
let mut state = print_imposition_start();
state = print_imposition_step(state, "sheets", 2.0);
println!(print_imposition_command(state));
state = print_imposition_step(state, "printed", 0.0);
println!(print_imposition_command(state));
state = print_imposition_step(state, "jam", 0.0);
println!(print_imposition_command(state));
state = print_imposition_step(state, "resume", 0.0);
println!(print_imposition_command(state));
state = print_imposition_step(state, "printed", 0.0);
println!(print_imposition_command(state));
state = print_imposition_step(state, "printed", 0.0);
println!(print_imposition_command(state));
state = print_imposition_step(state, "printed", 0.0);
println!(print_imposition_command(state));
}
Expected output
feed_sheet
turn_sheet
clear_back_jam
print_back
feed_sheet
turn_sheet
eject_job
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.2 | Download ZIP · Browse files | e94f445b10 | edec9127e684686237c73923335f04d466baa8e0c7bcb6852461178e3635f5eb |
| 0.1.1 | Download ZIP · Browse files | fcde5d764a | ec940d158b9846b13f263d53126072ce069217cee381872117b3ff55b9d2eb60 |
| 0.1.0 | Download ZIP · Browse files | 6349f23784 | f7dd8692315fc6538be730a4ab2212044021cd291263d19c6797e7e306be9046 |