Commit Graph
18 Commits
Author SHA1 Message Date
eliets2andeliets2 1f26293482 Save per-file batch log with step status and failure reasons (#6519)
* Save per-file batch log with step status and failure reasons

Users need an honest per-file record after a batch run instead of only opaque JSON, so a failing file and its reason are not lost.

Add a plain-text per-file log to the batch result and an optional CLI log path that writes one section per file with step status, output name and failure reason plus final counts, annotating step errors with the step name.

Test: batch_log_names_failed_file_step_and_reason failed before the change and passes after.

* Address review for pull request 6519

* Batch log: escape backslashes, wire the CLI log option

* Compare the escaped output path in the batch log test

* Address review for pull request 6519

* Repair review branch integration

* Format the files this pull request changes

* Repair review branch integration

* Repair review branch integration

* Keep dry-run output names clear of files that already exist

* Give the dry-run log test its own output folder

* Address review for pull request 6519

* Format the files this pull request changes

* Repair review branch integration

* Tighten the change after a final review

* Tighten the change after a final review

* Repair review branch integration

* Address review for pull request 6519

* Format the files this pull request changes

* Address review for pull request 6519

* Repair review branch integration

* Address review for pull request 6519

* Format the files this pull request changes

* Repair review branch integration

* Address review for pull request 6519

* Format the files this pull request changes

* Address remaining review requests

* Tighten the change after a final review

---------

Co-authored-by: eliets2 <[email protected]>
2026-12-03 15:39:04 +01:00
jweaver3 820f2eb32c cli: test ordinary extract, split and render through the atomic writer
On the revision integrated with main's shared atomic writer
(craft::atomic), ordinary extract, split and render write the requested
pages, parts and image size, leave the source byte-for-byte unchanged,
and leave nothing else in the folder. The missing-value regression also
checks that a refused command writes nothing and keeps the source.
2026-11-28 22:53:30 -05:00
jweaver3 0c8d342f1c cli: read option values without matching another option's operand
`flag(args, "--name")` matched any token, so a value-taking option's
operand was taken for an option. With a password of `--out`,
`extract --password --out in.pdf --pages 1 --out out.pdf` read `in.pdf`
as the output and wrote over the source file.

Add `value_of_flag`, which walks the arguments by the command's option
spec as `validate_options` and `positional` do, and move `info`, `text`,
`combine`, `extract`, `split` and `render` to it. An option left without
an operand at the end of the line is now reported instead of being read
as absent, and a repeated option's last value is the one used.

Fixes #7516
2026-11-28 21:54:40 -05:00
Dylan M. Taylor c55c9ca155 Use the native private token writer in the CLI fixture 2026-11-24 06:20:31 -05:00
Dylan M. Taylor cb94bfbaa0 pdf-shell-w12: net change of 2 commits
- pdf-shell-w12: written by an agent
- pdf-shell-w12: finished by an agent
2026-11-18 16:15:24 -05:00
FredApps 3d43364928 fix(crypt): write RC4 fixtures through the legacy entry points
Pinning craft-pdf to the #1852 merge SHA also picked up d74e60b2, which
makes create() and set_encryption() refuse RC4-40 and RC4-128. Tests,
helpers and the protect example that still write those schemes now use
create_legacy and set_encryption_legacy. Edit::Protect does the same
when the chosen algorithm is legacy, so a file that must stay readable
by a reader without AES can still be written.
2026-11-16 14:11:36 +01:00
Dylan M. Taylor eead454105 Cut over remaining codecs, xfa XML, and export packaging to craft-libs (#7326)
* chore: cut over image, png, tiff, and zune-jpeg to craft-image-codecs

* chore: cut over xfa XML parsing from roxmltree to craft-xml

* chore: cut over export DOCX and PPTX packaging to craft-opc and craft-xml

* style: cargo fmt
2026-11-14 13:49:46 -05:00
FredApps e6730be289 test: scope CPU override regressions to supported platforms 2026-11-13 14:08:57 +01:00
FredApps f52c6d8555 fix(startup): an OPENSSL_ia32cap naming a missing CPU feature no longer stops PdfCraft (#2916) 2026-11-12 18:53:52 +01:00
Dylan M. Taylor b4679deafd fix(cli): cap input reads, budget check's edit pass and escape its stderr records (#5997) 2026-11-09 18:38:34 +08:00
Dylan M. Taylor ba47f7bbc5 fix(cli): render needs the copying permission, as text does (#5990) 2026-11-09 18:38:17 +08:00
mtlcl410 59eee050c6 M14: the --control file is owner-only on Windows too, and the CLI checks it (#3922) (#3956) 2026-11-09 18:24:39 +08:00
3ae9093d61 M2: info lists the repairs made while opening, as Document Properties does (misc.cli-inspect) (#6518)
* M2: `info` lists the repairs made while opening, as Document Properties does (misc.cli-inspect)

`pdfcraft-cli info` now prints a `repairs` array: the notes about damage
repaired while opening that the app shows in Document Properties and
doc_info reports. It opens the document as the app does, once (the session
the dynamic XFA summary already used), so notes the app adds after reading
the objects, such as a page tree rebuilt from the pages found by scanning,
are listed too. A file the app cannot open for editing falls back to what
reading its objects repaired; a sound file prints an empty array.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

* M2: `info` runs none of the document's scripts while inspecting it (misc.cli-inspect)

The session `info` opens to read the app's repair notes and the dynamic XFA
layout now has JavaScript turned off, so an XFA form's initialize and
calculate scripts, which the app runs on opening, do not run during
inspection of an untrusted file. Before this branch the session was opened
for dynamic XFA forms only, and their scripts ran there too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

* M2: `info` reads the standards and repairs from the session it opens, and a laid-out form keeps its repair notes (misc.cli-inspect)

`info` now takes the declared standards (`Document::standards`, as the
Standards panel reads them) and the repair notes from the session it
opened, and reads the file once more only when the app cannot open it.
When opening lays out a dynamic XFA form, or writes any other revision,
the notes about damage repaired while reading the file now stay with the
re-read document, so Document Properties and `info` both list them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA

---------

Co-authored-by: mtlcl410 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-09 08:30:37 +08:00
eliets2andeliets2 7fd6860f4a M13 batch: pin the command-line exit codes before any change (#6296)
Co-authored-by: eliets2 <[email protected]>
2026-11-05 20:10:49 +01:00
jonathanwxh-cell f3861659e0 Merge remote-tracking branch 'upstream/main' into fix/cropbox-text-clipping
# Conflicts:
#	crates/render/src/text.rs
2026-10-27 20:18:31 +08:00
jonathanwxh-cell 4bf28ed735 Merge remote-tracking branch 'upstream/main' into fix/cropbox-text-clipping 2026-10-24 15:54:38 +08:00
aiongg 66c8db07a0 Merge PR #3849: cli: the argument bugs photocraft#7071 lists are live here too
Conflicts: apps/pdfcraft-cli/src/main.rs (render, check_one, check): kept main's bodies, positional() takes the option spec.
2026-10-24 06:21:50 +00:00
aiongg 9526363152 Build each crate's integration tests as one binary (#4087)
* Build each crate's integration tests as one binary

Every tests/*.rs file is its own executable that links the whole crate
graph. Move each crate's test files into tests/it/ as modules of one
tests/it/main.rs, for apps/pdfcraft, apps/pdfcraft-cli, automation, cos,
crypt, engine, render, sign and ui-egui. ui-egui's ui_group binary and
the support modules move into tests/it/ too. Crates with a single test
file keep it. The test executables go from 150 to 52, and every crate
runs the same number of tests as before.

ui-egui perf keeps its own binary (own process): its frame-time budgets
would charge each measurement for the other tests running beside it.

What the move needs:
- include_str!/include_bytes! and #[path] paths gain one "../".
- ui-egui: one GPU lock in tests/it/main.rs replaces the five per-file
  ones (content, document_links, editing, fill_sign, view), so one
  process creates one wgpu device at a time. The drop-line test in ui.rs
  and the screenshot blocks behind PDFCRAFT_*_SHOT(S) and
  CRAFT_UI_DOCKING_DIR, which render without holding it, take it too.
- pdfcraft winit_wayland_scroll: the vendored winit source it compiles
  names crate::event, so that shim lives in main.rs.
- parity evidence names the new paths.

* Name the one-binary test paths in docs and comments

- READMEs, docs, ATTRIBUTION and source comments name tests/it/<file>.rs.
- The oracle README's example filters with --test it encryption::qpdf_agrees.
- pdfcraft's GPU lock comment points at the UI tests' shared lock in
  crates/ui-egui/tests/it/main.rs.
2026-10-22 11:28:58 -04:00