mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-14 19:27:04 -04:00
A PDF can forbid copying its text. `pdfcraft-cli text` honours that and refuses, naming the owner password as the way through. pdftotext ignores the flag and extracts anyway, so the oracle was comparing our refusal against its text and scoring 0.000 -- measuring obedience, not quality. bug1815476.pdf is the case: a one-page Spanish form we render perfectly, whose text we decline to extract and pdftotext hands over regardless. It sat at the bottom of the worst list looking like a font bug, which is what sent me looking at it. Those files are now skipped and counted, not scored, and the count is printed rather than passed over in silence, on the same rule the oracle crate exists for: a comparison that did not happen must not look like one that succeeded. Over the first 250 corpus files that moves the mean from 0.811 to 0.854 and drops one file from the sample, with the median unchanged at 0.991. Permissions come from `Document::permissions`, so this is not a match on our own error text. A file that cannot be opened at all counts as permitted, because that is a different problem and dropping it quietly would hide it. Co-Authored-By: Claude Opus 5 <[email protected]>
18 lines
324 B
TOML
18 lines
324 B
TOML
[package]
|
|
name = "xtask"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
publish = false
|
|
license.workspace = true
|
|
|
|
[dependencies]
|
|
pdfcraft-oracle = { workspace = true }
|
|
pdfcraft-cos = { workspace = true }
|
|
anyhow = "1"
|
|
lopdf = "0.45"
|
|
png = "0.18"
|
|
serde_json = "1"
|
|
serde = { version = "1", features = ["derive"] }
|
|
sha2 = "0.11"
|
|
toml = "1"
|