PDF Text Extractor - Markdown & Page Citations avatar

PDF Text Extractor - Markdown & Page Citations

Pricing

from $5.00 / 1,000 successfully extracted pdfs

Go to Apify Store
PDF Text Extractor - Markdown & Page Citations

PDF Text Extractor - Markdown & Page Citations

Extract public text-based PDFs into Markdown and JSON with page numbers and character offsets for RAG source citations. Includes best-effort tables. No OCR. $0.005 per successful document, plus platform usage.

Pricing

from $5.00 / 1,000 successfully extracted pdfs

Rating

0.0

(0)

Developer

zihang

zihang

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Categories

Share

PageLedger — PDF to Markdown and page-cited JSON

Turn a public, digital-text PDF into Markdown plus page-level JSON so your RAG pipeline, research workflow, or citation layer can point back to the page that supplied each passage. Each successful result keeps page numbers and zero-based character offsets in concatenated extracted document text.

Use PageLedger when the source document is already available at a public HTTPS URL and you need a small, structured extraction step before indexing or quoting it. It does not fetch from private networks, and it does not turn scans into text.

What you receive

Each successfully extracted document is written to the default dataset with:

  • markdown: page-headed Markdown for the document
  • pages: per-page extracted text, page, and offsets in concatenated extracted document text (char_start and char_end)
  • source_url and source_id: source provenance for the input URL
  • table_status and extraction_warnings: review signals for table-heavy documents

Tables are best-effort. Complex visual layouts can need review before you use their cells as structured data.

Run it

Send one to ten public HTTPS PDF URLs. This is the W3C PDF used in the verified example below:

{
"urls": [
"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
]
}

Each PDF must be 10 MiB or smaller and have at most 50 pages. Downloading and parsing share a 30-second budget, and cloud runs require at least 1 GiB of memory. PageLedger rejects private-network addresses and unsafe redirects, encrypted PDFs, and scan-only PDFs. If any page, including a blank page, has no extractable text, the document is reported as unsupported with OCR_REQUIRED; PageLedger does not perform OCR.

Example result

The following is a shortened record from the W3C input above, captured from a successful cloud run. It shows the actual output fields and values used by this Actor:

{
"status": "ok",
"chargeable": true,
"pages": [
{
"page": 1,
"text": "Dummy PDF file",
"char_start": 0,
"char_end": 14,
"tables": [],
"table_status": "best_effort",
"status": "extracted"
}
],
"markdown": "## Page 1\n\nDummy PDF file\n",
"table_status": "best_effort",
"extraction_warnings": ["tables_are_best_effort"],
"elapsed_ms": 543.4,
"source_url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
"source_id": "c712e96563e8f8b0868ca5150548c4fde964b2a7d94061dd66473c0bc3b0d29a",
"url_log": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
}

Call from Python or HTTP

The synchronous dataset endpoint returns the run's dataset items. Set your token in the environment; the following example is documentation only and is not executed by this repository.

import json
import os
from urllib.request import Request, urlopen
token = os.environ["APIFY_TOKEN"]
request = Request(
"https://api.apify.com/v2/actors/gallant_fender~pageledger/run-sync-get-dataset-items?format=json&maxTotalChargeUsd=0.02&timeout=90",
data=json.dumps({
"urls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"]
}).encode("utf-8"),
headers={
"Authorization": f"Bearer {token}",
"Content-Type": "application/json",
},
method="POST",
)
with urlopen(request, timeout=120) as response:
items = json.load(response)

For raw HTTP, POST https://api.apify.com/v2/actors/gallant_fender~pageledger/run-sync-get-dataset-items?format=json&maxTotalChargeUsd=0.02&timeout=90 with the same JSON body and a bearer token returns the same dataset items. The example limits the total charge and sets the Actor run timeout to 90 seconds. Do not automatically retry a timed-out synchronous request: a retry creates a new run and can create a new fee. URL de-duplication applies only within one run. See the Apify synchronous dataset endpoint for timeouts and response options.

Pricing

PageLedger charges $0.005 for each successfully extracted PDF through Apify Pay Per Event. Platform usage is charged separately to the caller. Failed, unsupported, or rejected PDFs do not trigger the document-processed event fee. A repeated URL that already completed in the same run is skipped and does not create another result or event fee.