feat(pdf): add read-only source-content classifier (#33) - #97
Open
nonamexishere wants to merge 7 commits into
Open
feat(pdf): add read-only source-content classifier (#33)#97nonamexishere wants to merge 7 commits into
nonamexishere wants to merge 7 commits into
Conversation
Inspect the original source path and list existing text and image occurrences with unrotated PDF-space bounds, an opaque locator, and a supported/unsupported reason. Does not write a dest or edit page operators. Fixes McanKul#33.
Treat 180° text as ROTATED_TEXT, advance Tm after each show, refuse only applied signatures (not empty /FT /Sig widgets), keep operators after BI…EI, and scale text bounds by Tm×CTM.
Replace the same-agent fold with independently authored R1–R5 tests and a walker that does not edit those tests. Behavior is the same: 180° ROTATED_TEXT, Tm advance, empty Sig widgets, leftover ops after BI…EI, and Tm×CTM text bounds.
Strip only ID…EI payload so BI sees the live CTM. q/Q restores font metrics and Tc/Tw (not Tm/Tlm). Tc/Tw advance consecutive shows. Drop the fixture-history parenthetical on is_rotated_tm.
Indirect /Widths arrays are followed instead of falling back to Helvetica. Named and array Pattern color spaces refuse as PATTERN. ExtGState /SMask (not /None) marks following paints MASKED_IMAGE.
PDF cm / Form Matrix / Td / post-show Tm use mul(current, operand). Stacked cm now maps a unique image to (72, 400) 40×40; a scaled Tm plus a second Tj advances by 12× text-space width. Trm is unchanged.
Insert a newline between decoded /Contents chunks so Tj+ET cannot fuse into TjET. A two-stream page now lists both Hi and Lo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pagePdfpreview extract) and lists existing text and image occurrences.EditObject.rect), an opaque locator tied to a whole-file fingerprint, kindtext|image, andsupportedorunsupportedplus a specific reason code.DoisNESTED_FORM(real kind and bounds, never independently mutable).supportedmeans structurally classifiable for a later mutate loop. It is not a Save affordance and is not cover-and-overlay.Fixes #33.
Why
Spike #11 needs a machine that can emit explicit unsupported reasons before anyone opens a production “edit existing text/image” issue. Overlay stamps and
#34’s surviving source digest are not that machine. This is the#32corpus classifier only: no dest write, no PDFium, no Edit PDF UI.Validation
npm run buildnpm test(283)npm run typecheckcargo test --manifest-path src-tauri/Cargo.toml --lib(237, including 31source_contenttests)Privacy Checklist