Stirling-PDF
Stirling-PDF copied to clipboard
[Feature Request]: Table/Diagram Detection for Image Export
Feature Description
Feature Request: Table/Diagram Detection for Image Export
Proposal:
Stirling PDF can already export PDF pages as images. This feature request is for adding functionality to detect whether a page contains tables or diagrams (which are often misinterpreted by OCR, losing columns and structure), and automatically export those regions as separate images. This would allow for further analysis using advanced tools like Vision Language Models (VLM).
Why is this feature valuable?
Advantages:
- Lightweight and easy to integrate.
- More reliable detection of tables and diagrams compared to OCR.
- Enables efficient image-based analysis without deep content extraction.
This request will help improve the precision of table and diagram handling while keeping Stirling PDF’s performance lightweight and integrated.
Suggested Implementation
Suggested Approach:
- Export each page as an image – Leverage the existing functionality in Stirling PDF to convert each page into an image.
- Use basic visual detection – Apply image processing (e.g., OpenCV) to detect areas likely to be tables or diagrams. Detection would rely on identifying contours, shapes, and patterns that are characteristic of tables (rectangular grids) or diagrams (circles, lines, etc.).
- Filter for relevant zones – After detection, filter blocks based on size, aspect ratio, and geometric properties to distinguish text from diagrams and tables.
- Export detected zones – Once a diagram or table is detected, export it as a separate image file for further processing.
Additional Information
No response
No Duplicate of the Feature
- [X] I have verified that there are no existing features requests similar to my request.
Does this functionality work via PDF to CSV and then converting the CSV yourself?