mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-14 19:27:04 -04:00
M10.5: Preserve composed sheets with the shared scaling and duplex API
This commit is contained in:
1 parent
6614b370b1
commit
95434e9115
9 files changed
+22
-10
No files matched your search
Generated
+1
-1
@@ -1093,7 +1093,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-print"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=c22bb1b0ce6316f84973cb69675fe7331c5886cc#c22bb1b0ce6316f84973cb69675fe7331c5886cc"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=da752825c70574a2423ee55427f8f7aa5b5f8ec8#da752825c70574a2423ee55427f8f7aa5b5f8ec8"
|
||||
dependencies = [
|
||||
"tempfile",
|
||||
]
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ repository = "https://github.com/storytold/pdfcraft"
|
||||
# Shared frontend components; engines remain independent of egui.
|
||||
craft-ui = { git = "https://github.com/storytold/craft-libs", version = "0.1.0", rev = "5c874d51eeb3de70e735c8ce87a59a7dedd47675", features = ["serde"] }
|
||||
# Shared system spooler; document composition remains in pdfcraft-print.
|
||||
craft-print = { git = "https://github.com/storytold/craft-libs", version = "0.1.0", rev = "c22bb1b0ce6316f84973cb69675fe7331c5886cc" }
|
||||
craft-print = { git = "https://github.com/storytold/craft-libs", version = "0.1.0", rev = "da752825c70574a2423ee55427f8f7aa5b5f8ec8" }
|
||||
# internal
|
||||
pdfcraft-geom = { path = "crates/geom", version = "0.6.0" }
|
||||
pdfcraft-filters = { path = "crates/filters", version = "0.6.0" }
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
**Stage: alpha** · next: beta, ~26% (ready for real work 49% → 75%) and ~400–700 h away
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (shared print spooler; native Windows validation pending) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (shared print spooler; Windows CI enabled) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
|
||||
PdfCraft's one-page summary: how close it is to Adobe Acrobat Pro's offline feature set, and what
|
||||
comes next. Adobe's cloud services (Document Cloud, Acrobat Sign requests, shared review, the AI
|
||||
|
||||
@@ -126,12 +126,13 @@ impl Automation {
|
||||
printer: if printer == "default" { None } else { Some(printer.to_string()) },
|
||||
copies: a.opt_int("copies")?.unwrap_or(1).clamp(1, 999) as u32,
|
||||
collate: a.opt_bool("collate")?.unwrap_or(true),
|
||||
duplex: match a.opt_str("duplex")?.unwrap_or("off") {
|
||||
duplex: Some(match a.opt_str("duplex")?.unwrap_or("off") {
|
||||
"off" => spool::Duplex::Off,
|
||||
"long-edge" => spool::Duplex::LongEdge,
|
||||
"short-edge" => spool::Duplex::ShortEdge,
|
||||
d => return Err(bad(format!("unknown duplex {d:?}"))),
|
||||
},
|
||||
}),
|
||||
scaling: spool::Scaling::Exact,
|
||||
grayscale: a.opt_bool("grayscale")?.unwrap_or(false),
|
||||
title: name,
|
||||
options: match a.get("options") {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! stay in PdfCraft; these adapters retain the application's print-error surface.
|
||||
|
||||
pub use craft_print::{
|
||||
Duplex, HANDLED_OPTIONS, HAS_PRINTER_PREFERENCES, Job, Printer, PrinterOption, lp_args, lpstat_command, parse_lpoptions, parse_lpstat,
|
||||
Duplex, HANDLED_OPTIONS, HAS_PRINTER_PREFERENCES, Job, Printer, PrinterOption, Scaling, lp_args, lpstat_command, parse_lpoptions, parse_lpstat,
|
||||
parse_lpstat_e, parse_ppd, parse_windows_printers, ppd_text, printer_options, printers, printers_parsed,
|
||||
};
|
||||
|
||||
|
||||
@@ -194,10 +194,11 @@ fn spooler_arguments_and_printer_list() {
|
||||
printer: Some("Office_Laser".into()),
|
||||
copies: 3,
|
||||
collate: false,
|
||||
duplex: Duplex::LongEdge,
|
||||
duplex: Some(Duplex::LongEdge),
|
||||
grayscale: true,
|
||||
title: "memo.pdf".into(),
|
||||
options: Vec::new(),
|
||||
..Job::default()
|
||||
};
|
||||
assert_eq!(
|
||||
lp_args(&job).join(" "),
|
||||
|
||||
@@ -159,7 +159,8 @@ impl PrintDraft {
|
||||
printer: self.printer.clone(),
|
||||
copies: self.copies.max(1),
|
||||
collate: self.collate,
|
||||
duplex: self.duplex,
|
||||
duplex: Some(self.duplex),
|
||||
scaling: spool::Scaling::Exact,
|
||||
grayscale: self.grayscale,
|
||||
title: title.to_string(),
|
||||
// Only for the printer the options were read from.
|
||||
@@ -865,6 +866,15 @@ pub(crate) fn body(
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn composed_sheets_keep_exact_scaling_and_the_dialogs_duplex_choice() {
|
||||
let draft = PrintDraft { duplex: spool::Duplex::LongEdge, ..PrintDraft::default() };
|
||||
let job = draft.job("report.pdf");
|
||||
assert_eq!(job.scaling, spool::Scaling::Exact);
|
||||
assert_eq!(job.duplex, Some(spool::Duplex::LongEdge));
|
||||
assert_eq!(PrintDraft::default().job("report.pdf").duplex, Some(spool::Duplex::Off));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn print_preview_rasters_stay_within_the_texture_limit() {
|
||||
// Actual size on a 14,400 pt (200 in) page would ask for a raster far past any texture.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# PdfCraft architecture
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (shared print spooler; native Windows validation pending) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (shared print spooler; Windows CI enabled) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
|
||||
How PdfCraft is built today. The design rationale and the planned crates live in
|
||||
`plan/architecture.md` and `plan/adr/` (local-only); this file describes what is on `main`. Each
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Hardware and platform parity
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (shared print spooler; native Windows validation pending) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-11 · **Change:** minor (shared print spooler; Windows CI enabled) · **Target:** Adobe Acrobat Pro (Acrobat DC, continuous track 26.002.21931, macOS)
|
||||
|
||||
Each hardware feature Acrobat Pro uses, per platform, ours against Acrobat's. Acrobat runs on macOS
|
||||
and Windows (plus a limited web viewer/editor in Document Cloud); PdfCraft runs on macOS, Windows,
|
||||
|
||||
Reference in new issue
Block a user