Who it is forA developer building a document ingestion step who needs Markdown and JSON with layout data from PDFs.
The problemRaw PDF text loses tables, formulas, and reading order, which makes downstream processing unreliable.
The outcomeEach PDF produces a Markdown file and a JSON file with layout coordinates in an output folder.
What you need first
- A PDF or document image to parse
- Python 3.12 or Node.js for the SoMark CLI, or Docker for a local service
- For local hosting: Linux, an NVIDIA GPU with BF16 support, and 24GB or more of GPU memory
Steps
pip install somarksomark --base-url https://free-oxr.somark.ai/api/v1 --api-key dummy parse document.pdf --formats md,json --out ./parsed-output/(inferred, check the README)- Repeat the parse command for each file you need to convert. (inferred, check the README)
- Open the files in ./parsed-output/ and check the Markdown and JSON content.
Prompt for your agent
Using the OXR repo at https://github.com/SoMarkAI/OXR, install the somark CLI and parse <path-to-document.pdf> with the base URL https://free-oxr.somark.ai/api/v1, outputting md and json to ./parsed-output/. Verify that both output files exist and that the JSON includes layout coordinates.
Caveat. The README says the free API uses a queue, so processing speed may vary, and it is not recommended for production.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for SoMarkAI/OXR and "Convert PDFs to Markdown and JSON from the command line"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer