Commit Graph
6086 Commits
Author SHA1 Message Date
Osvaldo Duran MelendezandClaude Sonnet 5.5 6034de11bf Print a selected area: the automation test reads the printed PDF (sheet size, the area's clip rectangle, the page drawn through it)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 22:22:43 -05:00
Osvaldo Duran MelendezandClaude Sonnet 5.5 b00a4be12a Merge upstream/main into pr/print-area
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 18:53:16 -05:00
0c0f0b6b56 M10: grayscale with Print as image prints on a driver that keeps no grayscale (#5806) (#5882)
* M10: grayscale with Print as image prints on a driver that keeps no grayscale (#5806)

With Print as image and grayscale, PdfCraft renders the pages as grey
pictures itself, yet the job still asked the driver for grayscale. A
driver that keeps no grayscale setting, Microsoft Print to PDF among
them, made craft-print refuse the job ("the printer's driver did not
retain the requested grayscale; nothing was sent"), so even the grey
pictures never printed. The job now asks the driver for grayscale only
when the pages aren't grey pictures already
(print::driver_needs_grayscale), in the dialog and in doc_print.

The print.grayscale parity note and the doc_print as_image description
say so, and the note names what is still missing: vector pages to such
a driver are refused rather than printed in colour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* M10: the grey-pictures test checks that the pictures are grey too (#5806)

The test checked that grey pictures don't ask the driver for grayscale,
but not that the pictures are grey. A change that dropped grayscale from
the dialog's raster settings, while the job still skipped the driver,
would have printed in colour with the test passing. It now asserts both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: austin62jake <340374338+austin62jake@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-10 00:43:00 +01:00
Osvaldo Duran MelendezandClaude Sonnet 5.5 3613779a01 Snapshot: a document change puts the copied area away
Its page index would name another page after pages were deleted or moved.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 18:28:36 -05:00
efd7c9fc24 fix(print): fall back to the lpoptions listing when the PPD is unreadable (#4699) (#4703)
* fix(print): fall back to the lpoptions listing when the PPD is unreadable

cupsd keeps /etc/cups/ppd/<queue>.ppd at 0640 root:cups on Arch and
similar setups, so an ordinary desktop user cannot open it. The option
reader treated that permission error as "no options", and Print ▸
Properties… said "This printer offers no settings of its own" for a
queue whose driver options cupsd was serving all along through
lpoptions.

When the PPD is missing, unreadable, or parses to no options, the list is
now built from `lpoptions -p <queue> -l`. The options Craft handles
itself are skipped, as the PPD parser does, and the starred choice is the
fallback default.

Fixes #4699

* fix(print): skip CUPS custom-value templates in the lpoptions fallback

`lpoptions -l` prints `Custom`, `Custom.<TYPE>` (`Custom.PASSCODE`,
`Custom.STRING`, …) or `Custom.WIDTHxHEIGHT` in place of the choices of an
option whose value the user has to type. Nothing in the dialog collects that
value, so offering the template sent its literal text to the driver. Those
entries are now dropped, and a starred template never becomes the default.

The choice cap is also tested before the duplicate scan, so a listing past
`MAX_LPOPTIONS_CHOICES` no longer walks the stored choices on every token.

Refs #4699

* fix(print): refuse a destination that starts with a dash

`lpoptions` parses its argv with getopt, so `-p -E -l` reads `-E` as an
option rather than as the destination; `--` cannot help, because it ends
option parsing before the `-p` that names the queue. Reject a leading
`-` on the queue and on the instance component beside the existing name
checks, before the PPD is opened or the command is spawned.

* fix(print): read the listing by its last colon, and stop inventing a default

`list_group()` prints the option as `"%s/%s:"` from the PPD's keyword and
translated text and each choice as a bare `" %s"`, so a colon can sit in
the text but not in a choice keyword. Splitting at the first colon turned
the rest of the text ("Supporto: Tipo") into invented choices; split at
the last one instead.

When the choice CUPS marks is a custom-value template, the parser dropped
it and stood the first retained choice in as the default. The UI then
showed a value the job does not use, because only options changed away
from the default are submitted. Leave the default empty in that case:
there is nothing the dialog could collect, and an invented choice is
worse than no selection.

---------

Co-authored-by: Jarvis (Hermes) <jarvis@localhost>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-10 00:24:22 +01:00
Yusuf MANTAMandFredApps dc9d120fc8 feat(print): add Folio and F4 paper presets (#4777) (#4953)
Add Folio (8.5 x 13 in / 612 x 936 pt) and F4 (210 x 330 mm / 595.28 x 935.43 pt)
to the PAPERS preset table and map them to standard PWG 5101.1 media names
(na_foolscap_8.5x13in and om_folio_210x330mm) in cups_media.

Closes #4777.

Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
2026-11-10 00:08:47 +01:00
abb06c70f8 M10: the Print dialog remembers two-sided, grayscale, collate, sizing, comments & forms and Print as image (#2001, #6392) (#2103)
* M10: the Print dialog remembers two-sided, grayscale, collate, sizing and comments & forms (#2001)

Persist the choices that describe how this computer prints and restore
them on the next launch, under the names doc_print takes; copies, pages,
layout, orientation and the printer still start fresh for each job.
Those names now live in one place, pdfcraft_print::names, used by the
tool and the settings file. Settings are untrusted: an unknown name or a
custom scale outside the dialog's 1..=1000 % keeps the default.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* M10: the Print dialog also remembers a booklet's binding side (#2707)

Acrobat keeps the booklet binding (left or right) between prints;
PdfCraft started at Left every time. It is now kept with the other
remembered print choices, named as doc_print names it, and an unknown
saved value keeps the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* M10: Print starts each job's copies, pages, layout and orientation afresh (#2001)

CodeRabbit on #2103: the README promised that copies, pages, layout and orientation
start fresh, but open_print carried them over through `..keep` within a session.
ISO 32000-2 Table 147 initialises these per document when the print dialog opens
(NumCopies "typically 1", PrintPageRange), so each opening now resets them to the
defaults (Selected pages still win when thumbnails are picked); two-sided,
grayscale, collate, sizing, Comments & forms, binding, the paper and the printer
picked last carry over as before. Two-sided names now include "printer" (leave it to
the printer, main's default since #2422), so that choice is remembered too.
main's paper-persistence test expected grayscale not to persist; it is one of the
remembered preferences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* M10: a new print job also resets its layout's own options and leaves Label (#2001)

CodeRabbit on #2103: resetting the layout to Size kept pages per sheet, order, borders,
booklet subset and the poster options through `..keep`, so choosing Multiple again
brought back, say, a cut-and-stack order; and a job printed on Label went back to Size
without giving back the paper Label replaced. open_print now leaves Label through
set_handling (#3564) and resets the layout's own options with the rest of the job's
choices; the binding and sizing stay remembered. The README now says what resets on
each opening and what carries over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* M10: the Print dialog also remembers Print as image and its resolution (#6392)

A printer that needs pictures keeps getting them after a restart: as_image and
dpi are saved with the other print preferences and restored, a resolution the
dialog doesn't offer keeping the default 300 dpi. The bad-settings checks move
to their own test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: mtlcl410 <chuanlin@niar.org.tw>
2026-11-09 23:09:03 +01:00
eliets2andeliets2 a1ea2d3763 Align stream decode cap with renderer at 256 MiB (#6585)
Editor, export and redaction must not read or rewrite text that the page view and Find never see, which a mismatched cap allows on large streams.

Lower MAX_DECODED to 256 MiB to match the renderer cap, so every Stream::decoded-based content reader stops at the same byte and oversized streams error instead of exposing later text.

Test: decoded_stops_at_renderer_cap_of_256_mib failed before the change and passes after.

Co-authored-by: eliets2 <287273517+eliets2@users.noreply.github.com>
2026-11-09 18:54:53 +01:00
Osvaldo Duran MelendezandClaude Sonnet 5.5 a50b52ea84 Merge upstream/main into pr/print-area
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 10:50:00 -05:00
BFlat ba28458ad8 M3: a password prompt keeps a place in the open queue for its retry (#6731) 2026-11-09 22:21:21 +07:00
BFlat 5aae0c3b82 Merge pull request #6714 from storytold/merge/ui-print-optimize2
Land print production, viewer, attachment and optimizer changes (#1918, #1998, #2539, #2348, #2701, #3806, #4139, #4378, #4401, #4763, #5259, #5508, #5316, #4434, #4440, #6092, #6098)
2026-11-09 22:20:37 +07:00
bflatastic c45ac1a873 Merge main into merge/ui-print-optimize2
# Conflicts:
#	crates/ui-egui/src/app/files.rs
#	crates/ui-egui/src/tools/forms_ui.rs
2026-11-09 22:03:08 +07:00
BFlat d2139e58ae Merge pull request #6716 from storytold/merge/xfa2
Land XFA layout, scripting and form fixes (#3589, #4336, #4359, #4517, #4537, #4608, #4662, #4664, #4784, #4791, #5010, #5122, #5124, #5153, #5225, #5368, #5369, #5370, #5393)
2026-11-09 22:02:14 +07:00
bflatastic 302b61c7e3 Fit the landed changes together: the highlight test batches value edits, since a form-script event can't be batched 2026-11-09 21:43:02 +07:00
bflatastic e52b2de518 Fit the landed changes together: the full-screen note test expects its pop-up, and the lock-question test turns the signature tool on before opening the Sign menu 2026-11-09 21:42:59 +07:00
bflatastic 36e7121ab0 Merge main into merge/ui-print-optimize2
# Conflicts:
#	crates/render/src/inspect.rs
#	crates/render/src/lib.rs
2026-11-09 21:16:23 +07:00
bflatastic 16b57d6a91 Merge main into merge/xfa2
# Conflicts:
#	crates/engine/src/tests.rs
2026-11-09 21:15:35 +07:00
BFlat fe3879bc88 Windows gate: the owner-rights test allows an elevated run to replace the list, if it then restricts the file (#6729) 2026-11-09 21:14:18 +07:00
BFlat 2c30c14e10 Merge pull request #6713 from storytold/merge/comments-annot2
Land comment groups, appearance defaults, callout parts, pop-ups and stamp lines (#4358, #4365, #4094, #2137, #2345)
2026-11-09 21:14:02 +07:00
bflatastic 62b8a2c326 Fit the landed changes together: compare the node's name as text 2026-11-09 21:13:26 +07:00
bflatastic a460022c20 Fit the landed changes together: compare an XFA node's name without a needless reference 2026-11-09 21:10:40 +07:00
bflatastic 5f860fb5ff Fit the landed changes together: the XFA split's break search gets its own function, keeping it under clippy's complexity limit 2026-11-09 21:06:46 +07:00
bflatastic f822505250 Fit the landed changes together: the rotation keys get their own function, keeping the shortcuts under clippy's complexity limit 2026-11-09 21:04:55 +07:00
bflatastic 3774c3312a Fit the landed changes together
The forms editor's test draft sets the focus's obj and list, which main added, and the focus scripts look up the focused field with focused_field so a same-name twin is read as main reads it.
2026-11-09 21:03:12 +07:00
bflatastic 2af11131ef Merge main into merge/xfa2
# Conflicts:
#	crates/automation/src/tools.rs
#	crates/automation/tests/it/automation.rs
#	crates/forms/src/tests.rs
#	crates/ui-egui/src/tools/forms_ui.rs
#	parity/acrobat-features.toml
2026-11-09 20:57:05 +07:00
bflatastic 2ce2d3cf81 Merge main into merge/ui-print-optimize2
# Conflicts:
#	crates/automation/src/redact.rs
#	crates/automation/src/tools.rs
#	crates/print/src/lib.rs
#	crates/render/src/inspect.rs
#	crates/render/src/lib.rs
2026-11-09 20:56:15 +07:00
bflatastic 856d3fb0ac Merge main into merge/comments-annot2
# Conflicts:
#	crates/render/src/inspect.rs
#	crates/render/src/lib.rs
#	crates/ui-egui/src/canvas/page_pointer/tests.rs
#	crates/ui-egui/tests/it/comments.rs
2026-11-09 20:56:09 +07:00
Osvaldo Duran Melendez 924b435256 Merge remote-tracking branch 'upstream/main' into pr-fix/print-area 2026-11-09 07:07:01 -05:00
Osvaldo Duran MelendezandClaude Sonnet 5.5 447d9f0267 Merge upstream/main into pr/print-area
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 07:06:24 -05:00
bflatastic fb387d95d9 Fit the landed changes together: the lock-question test opens the Sign menu by its current label 2026-11-09 18:54:56 +07:00
bflatastic 99eaa73ca8 Fit the landed changes together: a double-click on a group member opens the group's pop-up 2026-11-09 18:54:18 +07:00
bflatastic 28585c01a5 Fit the landed changes together
- engine: the on_changes test's XfaRun literals set highlight; the script
  runner reads its template before borrowing the live form for to_js; has_event
  reads the paged live form, as the rest of the runner does, so focus scripts
  find a page-master copy by its own SOM path.
- js: property reads compare and copy the shared (Arc<str>) node text, and the
  property tests build XHost with its current signature.
- xfa: the Emitter test literal sets groups and used; a field split that is
  undone also restores the names handed out; rustfmt on a merged import.
- parity: drop the use/usehref gap from form.xfa-dynamic, as prototypes are now
  resolved before the template is parsed.
2026-11-09 18:46:50 +07:00
BFlat b6cbf9bb30 Merge pull request #6710 from storytold/merge/forms-links-text2
Land forms, links, find and redaction-save fixes (#4496, #4532, #3567, #3773, #4470, #4474, #4497, #5658)
2026-11-09 19:45:39 +08:00
BFlat 6b56de9ecf Merge pull request #6711 from storytold/merge/render-patches2
Land renderer patches, layer auto state, auto-tag artifacts, export clips and print page lookup (#3969, #4393, #4396, #4410, #4433, #4459, #4159, #5075, #5973)
2026-11-09 19:45:24 +08:00
BFlat 9f4191336d xtask: the private temp folder builder is mutable only on Unix (#6712) 2026-11-09 19:45:13 +08:00
bflatastic 720a841981 Merge #5393: M12: a picture an XFA form links is drawn from the PDF's XFAImages name tree (#5392)
# Conflicts:
#	crates/xfa/src/fixtures.rs
#	crates/xfa/src/tests.rs
2026-11-09 18:40:50 +07:00
bflatastic 9147411e9c Merge #5370: M12: a flowed XFA subform in a table cell is as tall as its content (#5367)
# Conflicts:
#	crates/xfa/src/layout/measure.rs
#	crates/xfa/src/tests.rs
2026-11-09 18:40:22 +07:00
bflatastic 9e55f61de0 Merge #5369: M12: an XFA subformSet is transparent to layout, so its members sit where their container puts them (#5366)
# Conflicts:
#	crates/xfa/src/layout/measure.rs
#	crates/xfa/src/parse.rs
#	crates/xfa/src/tests.rs
2026-11-09 18:39:26 +07:00
bflatastic ab2d4382ff Merge #5368: M12: XFA master-page fields keep their own value on each page (#5365)
# Conflicts:
#	crates/engine/src/xfa.rs
#	crates/xfa/src/layout/pages.rs
#	crates/xfa/src/lib.rs
#	crates/xfa/src/script.rs
#	crates/xfa/src/tests.rs
2026-11-09 18:38:21 +07:00
bflatastic 74b3452328 Fit the landed changes together: the print-settings discard is its own function 2026-11-09 18:37:28 +07:00
bflatastic c7f1fc7540 Merge #5225: M12: XFA field names made up for repeated fields never take a name the template uses (#5224)
# Conflicts:
#	crates/xfa/src/layout/common.rs
#	crates/xfa/src/tests.rs
2026-11-09 18:36:41 +07:00
bflatastic 0575de68ff Merge #5153: M12: an XFA subform without a height is as tall as its content, flowed or positioned (#5152)
# Conflicts:
#	crates/xfa/src/tests.rs
2026-11-09 18:36:01 +07:00
bflatastic 629d211506 Merge #5124: M12: XFA table rows start at their minimum height, and a growable row group splits at a page break (form.xfa-dynamic)
# Conflicts:
#	crates/xfa/src/layout/flow.rs
#	crates/xfa/src/layout/measure.rs
#	crates/xfa/src/tests.rs
2026-11-09 18:35:21 +07:00
bflatastic 8c19e0d1bd Merge #5122: fix(xfa): AcroForm field walks read each field once and bound what they queue
# Conflicts:
#	crates/xfa/src/pdf.rs
#	crates/xfa/src/tests.rs
2026-11-09 18:33:53 +07:00
bflatastic 85ebbab0ce Fit the landed changes together: modify.rs imports polygon_rect 2026-11-09 18:33:09 +07:00
bflatastic d92046f815 Fit the landed changes together
Format the attachment-key numbering kept from both sides of #5508's merge.
2026-11-09 18:32:42 +07:00
bflatastic 50f174afb7 Merge #5010: M12: XFA scripting object model (1/3): scripts read template properties as XFA 3.3 defines them
# Conflicts:
#	crates/engine/src/xfa.rs
#	crates/js/src/xfa/host.rs
#	crates/xfa/src/packets.rs
#	crates/xfa/src/parse.rs
#	crates/xfa/src/tests.rs
#	parity/acrobat-features.toml
2026-11-09 18:30:30 +07:00
bflatastic c994a0a4ac Fit the landed changes together
Comment literals in tests gain the callout text box and pop-up fields, and the review-state map is formatted.
2026-11-09 18:29:25 +07:00
bflatastic 74cc90dc50 Merge #6098: fix(forms): AFSimple_Calculate folds field values as it reads them, within an allowance
# Conflicts:
#	crates/forms/src/af/tests.rs
2026-11-09 18:28:11 +07:00
bflatastic 28247e037f Merge #6092: fix(a11y): annotation checks and form tagging stop copying shared annotation data
# Conflicts:
#	crates/a11y/src/tests.rs
2026-11-09 18:27:44 +07:00