Skip to content

Read the pages back: text and pictures - #6

Merged
tannevaled merged 1 commit into
mainfrom
text-verbs
Aug 25, 2026
Merged

Read the pages back: text and pictures#6
tannevaled merged 1 commit into
mainfrom
text-verbs

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Two verbs the tool was missing, on top of extract v0.1.0.

pdfops text paper.pdf
pdfops text -layout -pages 1 paper.pdf
pdfops images paper.pdf pictures/

text prints what a document says with the lines put back together; -layout prints where every piece of it sits instead — a page, a place, a size, and what it says:

1	50.40	740.43	9.96	Response
1	91.08	740.43	9.96	Letter
1	117.36	740.43	9.96	to

A piece the document gave no way to read comes back marked rather than guessed at, and so does one drawn with no ink — how a scanner writes what it read underneath the picture it read it from:

1	20.00	100.00	12.00	[invisible, part unreadable]

images writes out the pictures a page places, named by page and order, with a line saying how large each is and where it landed. A JPEG comes out as a JPEG rather than re-encoded.

Run over 400 corpus files for the text and 200 for the pictures: nothing failed. 100% statement coverage.

Two verbs the tool was missing, on top of the extractor.

text prints what a document says, with the lines put back together; -layout
prints where every piece of it sits instead — a page, a place, a size, and
what it says. A piece the document gave no way to read comes back marked
rather than guessed at, and so does one drawn with no ink, which is how a
scanner writes what it read underneath the picture it read it from.

images writes out the pictures a page places, named by the page and the order
they were placed in, with a line saying how large each is and where it landed.
A JPEG comes out as a JPEG rather than re-encoded, which is what anyone taking
pictures out of a document wants.

Run over four hundred corpus files for the text and two hundred for the
pictures: nothing failed, and 171 pictures came out of the two hundred.
@tannevaled
tannevaled merged commit 7b953b4 into main Aug 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant