Document to Markdown for RAG: PDF, DOCX, HWP
Pricing
from $4.00 / 1,000 document converteds
Document to Markdown for RAG: PDF, DOCX, HWP
Convert PDF, DOCX, PPTX, XLSX, CSV, HTML and Korean HWP/HWPX (beta) files you supply into Markdown, tables and RAG chunks with heading paths and PDF page numbers. Text-layer files only: no OCR, no web scraping. $0.004 per document + $0.0003 per page. Failed files are free.
Pricing
from $4.00 / 1,000 document converteds
Rating
0.0
(0)
Developer
Aaron Lee
Maintained by CommunityActor stats
0
Bookmarked
3
Total users
2
Monthly active users
14 days ago
Last modified
Categories
Features
Share
Document to Markdown for RAG converts PDF, DOCX, PPTX, XLSX, CSV, HTML, TXT/MD and Korean HWP/HWPX (beta) files into Markdown, tables and RAG chunks with heading paths and, for PDF, PPTX and XLSX, page numbers. It is for developers who feed documents to LLMs, vector databases and search indexes, and for teams that need Korean HWP files as text. Pricing: $0.004 per document + $0.0003 per page (a 20-page PDF is $0.010). Failed files and files with no extractable text are not charged.
What you get
- One dataset item per document:
markdown,tables(rows of cells),chunks(with metadata),warnings, and anerrorobject when a file fails. - Chunks follow the document structure: a new heading starts a new chunk, chunks stay under your token budget, and they overlap inside a section. Each chunk has
index,page(PDF page, PPTX slide or XLSX sheet number;nullfor other formats),headingPath,tokenCount,charStartandcharEnd.chunks[].textis exactlymarkdown[charStart:charEnd], so you can cite a source position. - Headings, numbered and bulleted lists (with nesting) and tables are kept as Markdown. Merged table cells become a rectangular grid.
- Deterministic in our tests: the same file and settings gave byte-identical output on repeat runs, so re-indexing stays stable.
- It reads only the files you give it (HTTP(S) links, files in your key-value store, or inline text). It does not crawl or scrape websites and does not run OCR.
Supported formats
| Format | Extensions | Notes |
|---|---|---|
| PDF (with a text layer) | .pdf | Headings guessed from font size, ruled tables, page numbers |
| Word | .docx, .docm (macros not run) | Headings, nested lists, tables |
| PowerPoint | .pptx | Slide titles, text, speaker notes, tables; slide number as page |
| Excel | .xlsx, .xlsm | One section and table per sheet (cached values) |
| CSV / TSV | .csv, .tsv | UTF-8, UTF-16 (with BOM), CP949 or Latin-1 |
| HTML, text | .html, .htm, .txt, .md | |
| Hangul (beta) | .hwpx, .hwp (5.x) | Text, headings, lists, tables |
Input example
{"files": ["https://example.com/reports/annual-report.pdf",{"key": "contract.hwp"},{"fileName": "notes.md", "text": "# Notes\n\n- first\n- second"}],"outputMode": "both","chunkSize": 800,"chunkOverlap": 100,"includeTables": true}
The pre-filled input is a small inline HTML document, so the first run works without any external file. {"key": ...} items need a key-value store selected in "Key-value store with your files". Google Drive, Dropbox and OneDrive share-page links return a web page, not the file, and fail with SHARE_PAGE_NOT_FILE; use a direct download link.
Output example (real run)
Run on the public NIST Cybersecurity Framework 2.0 PDF (32 pages), first 3 pages only (maxPagesPerFile: 3). Long text is shortened with "...". Every real item also has inputIndex, a tables list and fullOutput, left out here.
{"fileName": "en03_spec.pdf","format": "pdf","pageCount": 32,"charCount": 2818,"markdown": "# The NIST Cybersecurity Framework (CSF) 2.0\n\n## National Institute of Standards and Technology\n\nThis publication is available free of charge from: https://doi.org/10.6028/NIST.CSWP.29 February 26, 2024 Abstract\n\nThe NIST Cybersecurity Framework (CSF) 2.0 provides guidance to industry, government agencies, and other organizations to manage cybersecurity risks. ...","chunks": [{"index": 1,"text": "not used for CSF 2.0.\n\ni Acknowledgments\n\nThe CSF is the result of a multi-year collaborative effort ...","tokenCount": 130, "page": 2,"headingPath": ["The NIST Cybersecurity Framework (CSF) 2.0", "National Institute of Standards and Technology"],"charStart": 2363, "charEnd": 2817}],"warnings": ["Only the first 3 of 32 pages were processed (maxPagesPerFile)."],"error": null}
This sample also shows two imperfections. The title-page text and the word "Abstract" ended up in one paragraph, and the chunk starts mid-sentence because chunks are cut by token budget inside a section. On a 48-page NIST AI RMF PDF the title block came out twice at the top. Check the output on your own documents.
Use cases
- RAG indexing with citations. Convert a folder of PDFs and Word files, embed
chunks[].text, and storepage,headingPathandcharStart/charEndas metadata so an answer can point to a page and a heading. - Feeding long documents to an LLM. Turn reports, slide decks and spreadsheets into Markdown that keeps headings, lists and tables, before summarising or extracting fields.
- Korean government and enterprise documents. HWP and HWPX files, common in Korean public-sector work, come out as text, headings and tables (beta). In our check, 2 HWPX files and 1 HWP file from public Korean sources converted without errors.
Pricing
Pay per event:
| Event | When | Price |
|---|---|---|
document-processed | Each document converted successfully | $0.004 |
page-processed | Each PDF page or PPTX slide processed. Other formats: each started block of 3,000 Markdown characters | $0.0003 |
Examples: a 20-page text PDF = $0.004 + 20 x $0.0003 = $0.010. A 48-page PDF = $0.0184. A DOCX under 3,000 characters = $0.0043. Apify's standard run-start event is charged by the platform separately. Failed files, timeouts and files with no extractable text are not charged. A PDF that is only partly image-based is charged for every page processed, including image-only pages. The run stops cleanly when your maximum charge limit is reached.
Limits (please read)
We checked this Actor by reading its output for 28 real public documents (Korean and English PDFs, DOCX, XLSX, PPTX, HWPX, HWP). Coverage outside PDF is thin: 2 DOCX (both Korean), 2 XLSX, 1 PPTX, 2 HWPX and 1 HWP. We do not claim an accuracy percentage. Our own rough grading: about 12 were usable as they came out, 15 needed cleanup, and 1 (a 359-page NASA scan with a broken text layer) was not usable. Known problems:
- No OCR. Image-only pages return no text and a warning. A scanned PDF that already has an OCR text layer is read as-is, and that layer's mistakes (for example stuck-together words) come through unchanged.
- Statistics tables without ruling lines can come out misaligned. Rows and columns may not line up, row labels in an unruled label column may be lost, and some numbers end up as lines of text. LaTeX "booktabs" tables are usually flattened to text lines instead of being recovered as tables. Only ruled tables are detected reliably. Check statistics-heavy documents by eye.
- Footnote numbers can end up in the body text, for example a footnote marker glued to the next word.
- Layout: two-column pages are read column by column, but three or more columns, magazine layouts and slide-style PDFs can still come out in a mixed order. Text inside figures (axis labels, chart numbers) can appear as stray words, table-of-contents dot leaders come through as text, and a title block can be repeated at the top.
- Hyphenation: a line-end hyphen is removed only when the joined word occurs elsewhere in the same document, so some
representa- tionstyle breaks remain. - PDFs with a broken text layer: a page where more than 30% of the glyphs have no Unicode mapping is dropped with a warning and is not billed.
- Korean public documents: some bullets are not turned into lists, letter-spaced titles stay spaced out, and text that has no spaces in the PDF itself stays without spaces.
- DOCX: text boxes, headers/footers, footnotes, comments and tracked changes are not extracted. XLSX: formulas are not recalculated; a formula without a saved value comes out empty.
- HWP/HWPX are beta. Footnotes, headers/footers, text boxes, equations and images are not extracted. HWP 5.x numbering styles are written as
1.2.. Encrypted and DRM HWP files are rejected. - Not supported: password-protected files, legacy
.doc/.xls/.ppt, HWP 3.x. A per-file size limit (default 50 MB, max 200 MB) and a time limit apply.
FAQ
Does it crawl websites? No. It fetches only the exact file URLs you list, or records in your key-value store.
Can it read scanned PDFs? Only if the PDF already has a text layer. There is no OCR. Image-only pages give a warning and no text.
How are tables handled? Each table becomes a Markdown table and a rectangular rows grid. Merged cells keep the value at the top-left position and the covered cells are empty strings. PDF tables are reliable only when they have ruling lines.
How does chunking work? A heading starts a new chunk. Inside a section, chunks fill up to chunkSize tokens (default 800), preferring sentence and line ends, and overlap by chunkOverlap tokens (default 100). Token counts are an approximation, not a model tokenizer; leave 10-15% headroom if your embedding model has a hard limit.
What happens to a broken file? You get an item with markdown: null and an error such as INVALID_FILE, and the other files still run. Set failOnError to stop at the first error.
Are password-protected files supported? No. They are rejected and not charged.
What if a document is huge? If an item would exceed 8 MB, the dataset item holds a preview and fullOutput points to the complete Markdown, chunks and tables in the run's key-value store.
What happens to my files? They are converted in memory during the run and discarded. Results stay in your run's dataset and key-value store in your Apify account. Nothing is sent to a third party.
What is it built with? Permissive-license libraries (pdfplumber, python-docx, python-pptx, openpyxl, BeautifulSoup and others). The Actor was developed with AI assistance (Claude by Anthropic).
HWP format attribution: 본 제품은 한글과컴퓨터의 한/글 문서 파일(.hwp) 공개 문서를 참고하여 개발하였습니다. Microsoft Word, PowerPoint and Excel are trademarks of Microsoft; Hancom and Hangul are trademarks of Hancom Inc. This Actor is not affiliated with or endorsed by them.