Check your documents before integrating
Document parsing needs to be checked against the source: whether columns appear in the right reading order, headings have useful levels, tables retain their structure, and exported Markdown is suitable for further processing. A block of recognized text gives only part of that picture.
I built this local web demo to bring Baidu Cloud’s PaddleOCR-VL document parsing API and a result inspection interface together. After uploading a document, users can compare the layout, reading order and full JSON to assess whether the API fits their application.
The cover shows the actual project interface loaded with synthetic demonstration data. It illustrates the relationship between reconstructed layout and reading order; it does not show measured recognition results from the Baidu API.
Inspect the outputs together
The left pane previews source PDFs through PDF.js and images supported by the browser. For other formats, it attempts to reconstruct the page when the API provides valid coordinates. Layout elements and line coordinates can be overlaid to locate the content behind a result.
The right pane offers four views:
- Reading order lists elements in the order returned by the API, with click-to-locate interaction.
- Markdown displays the rendered output.
- MD source exposes the original Markdown and a download action.
- JSON preserves the full parsing structure for inspection and further development.
Table and image content may live outside an element’s text field. The interface uses layout_id to connect those elements to the corresponding table and image records.
From upload to inspection
The browser sends the file to a local Python service. The service obtains an access token, submits the parsing task and polls its status. When processing finishes, it downloads the Markdown and parsing JSON and returns them to the browser.
The backend uses the Python standard library, with no third-party Python packages or local model deployment. The frontend loads PDF.js and its Markdown renderer from a CDN, so preview and rendering still have network dependencies.
The asynchronous workflow exposes both waiting and failures. The demo checks task status every five seconds for up to ten minutes and displays API errors in the interface. It is intended for individual evaluation and has no task queue or concurrency scheduler.
Preserve the output for the next decision
Requests enable chart analysis, cross-page table merging, heading releveling, seal recognition and line coordinates. The interface retains the layout types returned by the service, including unknown types, so new output is still visible.
The project leaves business field extraction and rule-based corrections to later processing. That makes it possible to inspect what the model returned and determine what an application still needs. Markdown and JSON provide two inputs for subsequent retrieval or structured extraction work.
Local setup and scope
Use Python 3.9 or later, configure your Baidu API Key and Secret Key locally, run python3 server.py, and open http://127.0.0.1:8765. See the project repository for the source and setup instructions.
Documents are sent to Baidu Cloud and requests consume account quota. The server listens on localhost by default and has no accounts, authentication, database or result persistence. It is intended for evaluating document samples before integration. The main Markdown and JSON are downloaded when a task completes, but embedded images may still use temporary cloud URLs. Export results you need to keep.