PDF to Text and Markdown: Clean Text for RAG
Pricing
from $0.30 / 1,000 pages of text extracted
PDF to Text and Markdown: Clean Text for RAG
PDF to text and PDF to Markdown for RAG and LLM input: extract text from PDF files (URLs or stored keys) in reading order for one- and two-column pages, running headers, footers and page numbers removed, split words rejoined. Not for scanned PDFs (no OCR). USD 0.30 per 1,000 pages.
Pricing
from $0.30 / 1,000 pages of text extracted
Rating
0.0
(0)
Developer
Bardach Technologies
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
2 hours ago
Last modified
Categories
Features
Share
PDF to text and Markdown extractor for RAG and LLM input (PDF to text, PDF to Markdown): give it PDF URLs or stored PDF files and get clean text per page and per document, in reading order, with running headers, footers and page numbers removed and words split at line ends joined again. Every removed line is listed, so you can check what was taken out. Text PDFs only (no OCR). USD 0.30 per 1,000 pages with a text layer (pay per event; scans, failed and protected PDFs are free). To try it, start it with the prefilled sample PDF: 3 pages, no website needed, USD 0.00095.
Use it when
- you want to extract text from PDF files (reports, papers, manuals, filings) as plain text or Markdown for an LLM, a RAG index or search;
- page furniture (a running title on every page, "Page 7 of 20", a confidential footer) must not end up in every chunk;
- two-column papers must read left column first, then right column, instead of line by line across the page.
Do not use it when
- the PDF is a scan or a photo of pages: there is no OCR, such PDFs are reported as
no_text_layerand not charged; - you need the tables as rows and columns (this Actor gives table rows as lines of text, not cells);
- the layout has three or more columns, text in boxes around the page, or right-to-left scripts: reading order is only worked out for one and two columns;
- the PDF needs a password to open: such PDFs are reported as
password_requiredand not read (a PDF with only an owner password, which opens without one and only carries permission flags, is read like any other).
Minimal input (the sample run uses {"samplePdf": true} instead):
{"pdfUrls": ["https://www.example.com/annual-report.pdf"], "outputFormat": "markdown"}
One output row, as the prefilled sample run gave it on Apify on 2026-11-18 (the page row of page 2; text left out and markdown cut at the three dots; every PDF also gets one document row with the whole text):
{"recordType": "page", "sourceIndex": 0, "source": "sample:built-in", "page": 2, "hasText": true, "columns": 2, "markdown": "# Two columns\n\nAlpha one starts the left column and runs down the page for a while, then alpha two continues the same ...", "charCount": 491, "removedLines": [{"band": "header", "text": "Harbour Works Annual Notes - sample document", "reason": "repeated"}, {"band": "footer", "text": "Sample made for this Actor; all text is invented", "reason": "repeated"}, {"band": "footer", "text": "Page 2 of 3", "reason": "repeated"}]}
Cost in plain words: USD 0.0003 per page with a text layer that is written to the dataset (USD 0.30 per 1,000 pages), plus Apify's start event of USD 0.00005 per run. The prefilled 3-page sample costs USD 0.00095; a 478-page text PDF costs about USD 0.14. Measured on the Apify platform on 2026-11-18 at 1024 MB memory: the prefilled 3-page sample took 3.3 seconds; a 486-page statute (478 pages with text) took 187 seconds, and 51 seconds at 4096 MB.
How to convert PDF to clean text or Markdown
- Open the Actor on Apify. The form is prefilled with the built-in sample PDF, so a first run needs nothing else.
- For your own files, paste the PDF URLs under
pdfUrls(one per line), or upload PDFs to a key-value store, pick that store under 'Key-value store' (keyValueStoreId) and list their keys underpdfKeys. - Choose
outputFormat(text,markdownorboth) and, if you only need part of a file, a page range such as1-3,5,8-. - Start the run. The dataset holds one row per page and then one row per PDF with the whole text;
removedLinesshows every header, footer and page number that was taken out. - To run it from your own code or at regular intervals, use the Apify API, a recurring run, a webhook or an integration from the Actor's page; the same input JSON works everywhere.
Use cases
- RAG and search indexes: page rows are ready-made chunks without the running title and page number in each of them.
- LLM input: summarise or question reports, filings, laws, manuals and papers without paying tokens for repeated page furniture.
- Two-column papers: text in reading order, left column before right column, with split words joined.
- Document pipelines: one row per PDF with status, page counts and warnings, so a failed, protected or scanned file is reported instead of silently missing.
- Auditable cleaning: every removed line is listed with its page, band and reason, and one switch keeps everything.
Sample output table
The one-click default run (the built-in 3-page sample PDF; 26.11.2026) wrote 4 rows (3 page rows and 1 document row) and cost USD 0.0009 (3 x 0.0003) plus Apify's start fee (USD 0.00095 in total). The document row says 3 pages read, 3 with text, 186 words, 1,068 characters. The page rows:
| page | columns | charCount | first Markdown line | header or footer lines removed |
|---|---|---|---|---|
| 1 | 1 | 283 | # Introduction | 2 |
| 2 | 2 | 491 | # Two columns | 3 |
| 3 | 1 | 290 | # Closing notes | 2 |
Input
| Field | Default | What it does |
|---|---|---|
pdfUrls | none | Public http(s) URLs of PDFs, up to 50 PDFs per run in all, each at most 50 MB |
pdfKeys, keyValueStoreId | none | PDFs stored in a key-value store (this run's own store, or one you pick in the field 'Key-value store' or pass by its ID; it is only read) |
samplePdf | off (the form prefill ticks it) | Reads the built-in 3-page sample |
pages, maxPagesPerPdf | all pages, 500 | Page range such as 1-3,5,8-; at most 500 pages per PDF |
outputFormat | both | text, markdown or both |
includePageRows | on | One row per page before each PDF's document row |
stripRepeatedLines, minRepeatPercent | on, 60 | Remove running headers, footers and page numbers; how often a line must repeat |
joinHyphenation | on | Join words split at a line end |
timeoutSecPerPdf | 300 | Stop reading one PDF after this many seconds (10 to 900) and return the pages read |
With no source at all the run ends at once with a summary and no rows.
Output
For every PDF, in input order:
- one page row per page read (switch off with
includePageRows): page number,textand/ormarkdown,hasText,columns(1 or 2),truncated(the page's text was cut at a per-page limit, see Limits),removedLines; - then one document row:
status,reason, page counts, the whole document'stextand/ormarkdown(paragraphs flow across page and column breaks), every removed line with its page, band and reason,chargedPages,wordCount,warnings. A document too large for one dataset row (over 8 MB) keeps its text in the key-value store (textKey,textUrl,markdownKey,markdownUrl).
The run summary is the OUTPUT record: outcome is complete (every PDF read in full), incomplete (some PDF failed, was skipped, had no text layer, was stopped at a limit or cut at the page limit) or stoppedEarly (your maximum charge was reached; what was written is complete and charged).
Statuses of a document row: processed, partial (stopped at the time, memory or CPU limit: the pages read before the stop are returned, nothing after them), no_text_layer, failed, password_required, skipped_robots, blocked_unsafe, skipped_refused (the URL's host refused an earlier request of this run with HTTP 401, 403, 407, 429 or 451, answered it with a bot challenge, or its robots.txt refused with one of those codes, so this URL was not requested). Only processed and partial count pages for the price (chargedPages), and only pages with text that were not cut (truncated): USD 0.0003 each. source is the entered link or key as it may be shown: a link keeps scheme, host and path, without query, fragment or login, and a link or key that holds an e-mail address or a phone number (+ and 8 to 15 digits, tel:, mailto:, wa.me) is shown as <scheme>://<host>/[removed] when the contact is in the path, and as <scheme>://[removed]/[removed] when the contact is in the host name (a key is masked in the same way; percent-encoding is read up to 8 times, so a contact hidden under more rounds of encoding is not found); the real link is the one requested. sourceKey (document rows) is a hash of the entered link or key, which a restart compares instead of the shown text. The text of your PDFs is delivered as written and is not masked. finalHost is the host name the PDF came from after redirects (a host name that holds a contact is shown as [removed] there, as in the reasons of a failed or refused row); the path and query of a redirect target are never written (a signed storage link carries its credentials there). A PDF whose rows cannot be written to the dataset gets one free failed row instead and the run goes on; if the dataset refuses a write after some of its page rows were written, those rows stay, their pages are charged and a partial document row says how many were written (without the document text). If even that row cannot be written, the run stops with the error.
How the text is cleaned
- Text layer only. Upright characters on the visible page are read with pdfminer.six through pdfplumber. Sideways text (margin stamps), text outside the page and glyphs without a character mapping are dropped and counted. No OCR.
- Reading order. Words become lines; a page is two-column when a vertical gap in the middle 30 to 70 % of the text block has at least 5 lines of 4 or more words on each side that fill most of their column. Full-width lines (titles, captions) stay in place; between them the left column is read before the right column. Otherwise the page is one column, top to bottom. Pieces of a word that touch are one word: in the same font size, or in small capitals (a full-size initial followed by smaller capitals on the same baseline, so "JUSTICE" is not split into "J USTICE"); a smaller index in a formula keeps its space.
- Headers, footers and page numbers. A line is a candidate only when it stands apart from the page's text block: walking in from the top edge and from the bottom edge, rows of at most two lines that are followed by a gap larger than the page's usual line spacing plus 0.6 font sizes are set apart, up to three such groups within the outer quarter of the page, as long as some text is left between them. A line that repeats but sits in the text block at its normal line spacing (a table's column header repeated on every page, a section title right above the text, a last line "Confidential") is not a candidate and stays. A candidate is removed when:
repeated: its text, digits and spaces ignored, is on at least 60 % of the pages with text (minRepeatPercent, 30 to 100) and on at least 3 pages; or, in the outer 10 % of the page or in a place the heads take on most pages, on 60 % of the odd or of the even pages and under 40 % of the others (book style). A copy set 1.3 times larger than usual (a paper's title on page 1 that is also its running head) stays, and outside the outer 10 % of the page a line set as a heading (1.15 times the body size or larger) is never removed for repeating;repeatedInSection: it is a line of its own, set smaller than the body text (at most 0.9 times its size), in a place that lines set apart take on most pages, and the same words repeat there on at least 60 % of the pages from its first to its last page and on at least 3 pages: a running head that changes per chapter, part or section;runningHeadSlot: such a small line of its own in a place where most of these lines were found to be running heads (a section's head that is on one page only);pageNumber: it is only a page number (7, - 7 -, 7 / 20, Page 7, Page 7 of 20, p. 7, vii) that follows the page order;runningHeadWithPageNumber: a page number that follows the page order next to a title seen on at least 2 pages, or in the place where running heads were found on at least 3 pages. Lines in the outer 10 % that are close to the text are removed only as page numbers or as a copy of a running head that stands apart on other pages in the same place. Every removed line is listed inremovedLineswith its band, text and reason; setstripRepeatedLinesto false to keep everything.
- Split words. "infor-" + "mation" becomes "information"; the hyphen stays when the next part starts with a capital or a digit (COVID-19), when the document itself writes the hyphenated word (well-known), or when the next part holds a hyphen itself (state- + of-the-art becomes state-of-the-art). A suspended hyphen before und, oder, and, or, nor, bzw., sowie or & keeps the hyphen and the space ("Post- und Fernmeldewesen", "pre- and post-processing"). Soft hyphens are removed.
- Paragraphs and Markdown. A line joins the paragraph above when that line reached its column's right edge (or the next word would not have fitted after it) and the gap is small; a jump to the next column or page continues a paragraph the same way. A first line indented by 0.8 to 8 font sizes against the line above, followed by a line back at the left edge, starts a new paragraph even after a full line; a hanging indent (all lines after the first set in) does not. Lines 1.15 times the body font size or larger are headings (
#from 1.6 times,##from 1.3,###below); bullet lines become-items.
Limits
- Up to 50 PDFs per run (URLs, keys and the sample together), each file at most 50 MB, at most 500 pages per PDF (
maxPagesPerPdf). - Per page at most 20,000 words, 2,000 lines and 512 KB of text (UTF-8), and a page row stays under 8 MB: a page over one of these is cut, its row says
truncated: true, and it is not counted for the price. Per PDF at most 16 MB of text: reading stops at the page that would pass it (the document row's warnings say so). - CPU budget per PDF: 20 CPU seconds plus 0.5 per page asked for (
maxPagesPerPdf), never more thantimeoutSecPerPdf, and 15 CPU seconds per page. A normal page needs well under a second (about 0.1 measured on the platform). A PDF or page over its budget is stopped like at the time limit: the pages read before are returned (partial), or the PDF isfailedwhen there are none. Every encoded stream (Flate, LZW, RunLength, ASCII85, ASCIIHex, fax) may expand to at most 64 MB; image data is never decoded. - Reading one PDF stops after
timeoutSecPerPdf(10 to 900 seconds, default 300); the pages read before the stop are returned (partial). Putting the text together afterwards has its own time, counted from the end of reading: the same limit plus 10 seconds, so a PDF read up to its limit still gets as long for this step as the reading had; a PDF whose text step needs longer than that gets a freefailedrow whose reason starts withtimeout:. A download has its own 60-second limit. - No OCR; no passwords; no tables as cells; one or two columns only.
- A real line that is set apart near the top or bottom of most pages (a document title not set larger than the text, in the outer 10 % above the text of every page; "(Continued)" under continued tables) is removed as a running head; so is a small line set apart on its own in the running-head place over a stretch of pages. Such lines are listed in
removedLines, andstripRepeatedLines: falsekeeps them. - Not found: a running head in the body font size that is on only part of the document (a date at the top of the text pages of a report with many table pages), a head that is close to the text on a page with wide line spacing, and a running head that changes per chapter when it is set as large as the body text and carries no page number.
- The rules are heuristics: unusual layouts (sidebars, pull quotes, text in boxes) can be read in the wrong order.
- Two printed pages on one PDF page (a booklet spread): each half is read as a column, but the pair of page numbers under them ("6 7") is not removed.
- A real compound split at a line end loses its hyphen when the document never writes it inside a line (about 1 in 100 joined words in the files read by hand).
- A scanned PDF still gets one page row per page (
hasTextfalse, empty text) and its document row. - The words "charged" and
chargedPagesin messages and rows mean "counted for the price" (USD 0.0003 per page). - Speed, measured on the Apify platform on 2026-11-18 with a 486-page text PDF: about 2.8 pages per second at 1024 MB and about 10.8 pages per second at 4096 MB. At 1024 MB that file needed 174 seconds; the default limit is 300 seconds per PDF, about 840 pages' worth at that speed. A slower PDF that runs out of time comes back as
partialwith the pages read; for such files raisetimeoutSecPerPdfor the run's memory. - Pay per event has not yet run on the platform for this Actor: charging, the maximum-charge stop and "no page charged twice after a resume" were tested only with the SDK's local simulation.
Safety
- Only the URLs you list are requested (and their redirects, at most 5). For every request the host is resolved first and every address must be public (no private, loopback, link-local, multicast, reserved, cloud-metadata or IPv4-in-IPv6 addresses); only then is robots.txt asked, and a URL it does not allow is skipped (
skipped_robots); so is a URL whose robots.txt cannot be read (a network error, a server error or too many requests), and the reason says which of the two it was. A PDF host that answers 401, 403, 407, 429 or 451, or a bot challenge (recognised by the answer's structure: acf-mitigatedor AWS WAF challenge header, or a 202 web page where a PDF was asked), and a host whose robots.txt answers one of those codes, or with a bot challenge or a web page instead of the text file, is not asked again in the run, also after a restart (not even for robots.txt): its remaining URLs get freeskipped_refusedrows without a request. robots.txt is asked only on the host you entered; a redirect of robots.txt is followed only to the same host or its www twin, and a redirect of a PDF to another host is followed without asking that host's robots.txt. An address written in a non-standard numeric form (127.1, 0177.0.0.1, 2130706433) is refused. At most one request per second per host, the robots.txt request included, a generic user agent, no cookies, no compressed transfers, a size cap while streaming. - Each PDF is read in a separate process that is killed at the time limit or at its memory limit and gets no tokens or other secrets. Nothing in a PDF is executed (no JavaScript, no launch actions, no embedded files are opened); compression bombs are refused.
- Resume: after a crash or migration the run checks its own output (counts and a hash chain) and continues after the last complete PDF; a page is never charged twice. A write cut off in the middle is refused with a clear message instead of guessed.
Pricing
Pay per event: USD 0.0003 per page with a text layer that is written to the dataset (USD 0.30 per 1,000 pages), event page-processed, charged right after the PDF's rows are written, plus Apify's start event (USD 0.00005 per run). Pages without a text layer (scans), failed, password-protected, robots-skipped or blocked PDFs, and pages not written because your maximum charge was reached are free. A PDF stopped at its time or memory limit is charged only for the pages it returned.
Cost examples: the prefilled sample run (3 pages) costs 3 x USD 0.0003 + USD 0.00005 = USD 0.00095. A 100-page report with text on every page costs USD 0.03 plus the start event. 1,000 pages cost USD 0.30. If 20 of those 1,000 pages are scans, 980 pages are charged: USD 0.294. The Store page always shows the price that applies to your run.
FAQ
Does it read scanned PDFs? No. There is no OCR. A PDF without a text layer is reported with status no_text_layer; a file with some scanned pages gives text for the other pages and lists the pages without text.
A line I need was removed. What now? Look at removedLines: it names the page, the band (header or footer), the text and the rule. Set stripRepeatedLines to false to keep every line, or raise minRepeatPercent so that only lines on more pages count as repeated.
A running head was not removed. Why? The rules need a head to stand apart from the text and to repeat, or to carry a page number that follows the page order. The cases that are not found are listed under Limits.
What does it cost? USD 0.30 per 1,000 pages with a text layer, plus Apify's start event of USD 0.00005 per run. Scans, failed and protected PDFs are free (see Pricing).
Do I get tables? Table rows come out as lines of text in reading order, not as cells.
How long does it take, and how much memory? Measured on the Apify platform on 2026-11-18: about 2.8 pages per second at 1024 MB (486 pages read in 174 seconds) and about 10.8 pages per second at 4096 MB (45 seconds); the highest memory use seen in any run was 104 MB. The sample run takes about 3 seconds. Each PDF has its own time limit (timeoutSecPerPdf, default 300 seconds); what was read before the limit is returned as partial.
Which URLs are requested? Only the ones you list and their redirects, after a check of the address and of the site's robots.txt; a URL that robots.txt does not allow, or whose robots.txt cannot be read, is skipped and reported with the reason.
Can I call it from code or from an AI agent? Yes: through the Apify API and its clients, recurring runs, webhooks and integrations, and through Apify's MCP server; the input and output are plain JSON.
Related Actors
- Dataset Merge & Deduplicate: merge the page rows of several runs into one dataset and remove duplicates.
Accuracy, measured on real PDFs
Short version: on 8 public PDFs (284 pages) that the rules had never seen, measured after the last rule change, 99.6 % of the removed words were page furniture (precision 0.9961), 95.5 % of the furniture words were removed (recall 0.9550) and 99.6 % of the body words were kept (body recall 0.9963; body precision 0.9952). An earlier version of the rules found only 58.8 % of the furniture on a first set of unseen files; that measurement and what was changed after it are shown below, so you can judge how far the numbers carry to your documents.
How it is measured: for each file the header, footer and page-number lines were written down by hand (position band, text pattern, pages) before the cleaner was run on it. The reference reading is a plain pdfplumber word list grouped into lines; words are compared per page as runs of letters or digits.
- furniture precision = removed words that are furniture / all removed words; furniture recall = removed furniture words / all furniture words;
- body recall = body words found in the page's text / all body words; body precision = output words that are body words / all output words.
Held-out set, first measurement before any rule was changed for these files
8 public PDFs, 1,035 pages, chosen and measured by an independent check (18.11.2026) on files the rules had never seen: a book with chapter titles in its running heads, a two-column conference paper, a statute whose heads change per section, lecture slides, a court opinion with wide margins and heads that change per part, a court form, an energy report with many tables, and a German law. This is the number to expect on documents unlike the development files.
| Document | Pages | Furniture precision | Furniture recall | Body recall | Body precision |
|---|---|---|---|---|---|
| Think Python 2e (book) | 244 | 1.0000 | 0.7126 | 0.9998 | 0.9957 |
| PMLR radford21a (two columns) | 16 | 1.0000 | 1.0000 | 0.9871 | 0.9950 |
| Title 17 circular (statute) | 486 | 0.9827 | 0.5167 | 0.9997 | 0.9848 |
| CS231n lecture 2 (slides) | 61 | 1.0000 | 0.9836 | 0.9989 | 0.9905 |
| Supreme Court slip opinion | 114 | n/a (nothing removed) | 0.0000 | 0.9974 | 0.9653 |
| Form AO 239 | 5 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| EIA Short-Term Energy Outlook | 58 | 1.0000 | 0.8333 | 0.9525 | 0.9168 |
| Grundgesetz (German) | 51 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Total (8 PDFs) | 1,035 | 0.9913 | 0.5880 | 0.9938 | 0.9785 |
Fresh set, measured after the rules were changed (the independent number for the current rules)
8 more public PDFs, 284 pages, collected by the independent check before the rules were changed and kept away from whoever changed them; their header and footer lines were written down before the changed cleaner was run on them (18.11.2026). No rule was changed afterwards.
| Document | Pages | Furniture precision | Furniture recall | Body recall | Body precision |
|---|---|---|---|---|---|
| NIST SP 800-207 (technical report) | 59 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Nature article (two columns) | 12 | 1.0000 | 0.9649 | 0.9781 | 0.9910 |
| European Convention on Human Rights (booklet, two printed pages per PDF page) | 34 | 1.0000 | 0.0169 | 0.9952 | 0.9859 |
| CS224n lecture 1 (slides) | 40 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Federal Reserve Monetary Policy Report, July 2024 | 79 | 0.9880 | 1.0000 | 0.9953 | 0.9911 |
| OPM Standard Form 85 (no running heads at all) | 18 | n/a (nothing removed, which is right) | n/a (none in the file) | 1.0000 | 1.0000 |
| World Bank Pink Sheet (price tables) | 3 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Constitución Española, consolidated (Spanish) | 39 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Total (8 PDFs) | 284 | 0.9961 | 0.9550 | 0.9963 | 0.9952 |
Missed here: the pairs of page numbers under the booklet's two printed pages per PDF page (30 lines, see Limits) and 2 footer lines of the journal article. Kept, as they should be: 14 "Artículo n." headings that sit in the top 10 % of their pages, the column headers repeated on both table pages, and every slide title. The one removal counted as wrong in the Federal Reserve report is a running head that the hand-written pattern did not cover on one page.
The same 8 files after fix round 1: after the rules were changed with these files in view, so no longer an independent test
The check found running heads below the top 10 % of the page, heads that change per section, one-page section heads and small capitals split into pieces; the rules in "How the text is cleaned" were changed for these cases (general rules, no rule names a file). Measured on the same files afterwards:
| Document | Pages | Furniture precision | Furniture recall | Body recall | Body precision |
|---|---|---|---|---|---|
| Think Python 2e (book) | 244 | 1.0000 | 0.9862 | 0.9998 | 0.9993 |
| PMLR radford21a (two columns) | 16 | 1.0000 | 1.0000 | 0.9872 | 0.9952 |
| Title 17 circular (statute) | 486 | 0.9904 | 0.9950 | 0.9998 | 0.9997 |
| CS231n lecture 2 (slides) | 61 | 1.0000 | 1.0000 | 0.9989 | 0.9977 |
| Supreme Court slip opinion | 114 | 1.0000 | 0.9918 | 0.9992 | 0.9983 |
| Form AO 239 | 5 | 1.0000 | 1.0000 | 0.9902 | 0.9951 |
| EIA Short-Term Energy Outlook | 58 | 1.0000 | 0.8333 | 0.9525 | 0.9168 |
| Grundgesetz (German) | 51 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Total (8 PDFs) | 1,035 | 0.9946 | 0.9920 | 0.9940 | 0.9897 |
Reading-order checks on the two-column paper: 8 of 8. Still missed: the date at the top of the energy report's 15 text pages (set in the body font size on part of the report only; see Limits). The statute's lowest precision is a scoring effect: four footers are printed twice over themselves and the reference reading counts each word twice. The form's lower body recall is one too: the reference reading splits the small capitals of UNITED STATES DISTRICT COURT into pieces that the cleaner now reads as whole words.
The 12 development files the rules were developed on
12 public PDFs (712 pages): Federal Reserve releases and its annual report, a Bank of England report, two IRS publications and three arXiv papers (two of them two-column). The rules were built and tuned on these files, so they flatter the cleaner.
| Value | |
|---|---|
| Furniture precision | 0.9941 |
| Furniture recall | 1.0000 |
| Body-text recall | 0.9983 |
| Body-text precision | 0.9993 |
| Reading-order checks (hand-picked sentence sequences across columns) | 11 of 11 |
| Words split at a line end and joined | 1,352 |
| Document | Pages | Furniture precision | Furniture recall | Body recall | Body precision |
|---|---|---|---|---|---|
| Federal Reserve G.19 release | 3 | n/a (none in the file) | n/a (none in the file) | 1.0000 | 1.0000 |
| Federal Reserve H.4.1 release | 11 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Federal Reserve H.8 release | 22 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Federal Reserve Summary of Economic Projections | 17 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Federal Reserve Z.1 Financial Accounts | 205 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| Federal Reserve Annual Report 2023 | 222 | 1.0000 | 1.0000 | 0.9940 | 0.9988 |
| Bank of England Monetary Policy Report | 90 | 1.0000 | 1.0000 | 0.9999 | 1.0000 |
| IRS 1040 Tax Table instructions | 28 | 0.8308 | 1.0000 | 0.9994 | 0.9999 |
| IRS Publication 15-T | 71 | 1.0000 | 1.0000 | 1.0000 | 1.0000 |
| arXiv 1810.04805 (two columns) | 16 | n/a (none in the file) | n/a (none in the file) | 0.9963 | 0.9952 |
| arXiv 1512.03385 (two columns) | 12 | 1.0000 | 1.0000 | 0.9819 | 0.9928 |
| arXiv 1706.03762 (one column) | 15 | 1.0000 | 1.0000 | 0.9933 | 0.9866 |
What the numbers mean and do not mean: the lowest furniture precision on the development files (IRS tax table instructions) comes from the word "(Continued)" at the bottom of continued tables, which repeats on most pages and is removed although the reference counts it as body text. The lowest body recall comes from figure labels and formulas. Paragraph boundaries and Markdown headings are not part of this measure. Checked separately on two of the held-out files: in the German law 686 of 690 lines that start a numbered paragraph or an article start a paragraph in the output; in the court opinion 193 of 202 indented first lines do. Split words, hand-read on four English files: about 1 in 100 joined words is a real compound that lost its hyphen ("self-serving" at a line end comes out as "selfserving" when the document never writes it inside a line). These are 28 documents, not a guarantee for yours: check removedLines on your own files.
Licences
Built on pdfplumber (MIT licence) and pdfminer.six (MIT licence). The sample PDF and the unit-test fixtures are made for this Actor with invented text.