Idea: use individual "configs" to manage parsing process
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 2.7k
- Forks
- 579
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
Disclaimer: This issue is just a starting point for some ideas i got after working with PDFParser in the last couple of days. So for now, please don't expect anything from it besides some discussion. If someone wants to create PR's based on this, you are welcome.
Issue: There are scenarios in which you need a certain "config" when parsing a PDF. E.g. the PDF requires certain settings or has features, which PDFParser can't handle but you wanna get the most out of it.
Here some use cases which might fit:
- https://github.com/smalot/pdfparser/issues/259: @nickano asks about making PDFObject's
$font_spacevalue configurable from outside. - https://github.com/smalot/pdfparser/issues/294: define your own threshold for a variable to keep
\nin parsed text. - https://github.com/smalot/pdfparser/pull/87#issuecomment-638621328, its about how to separate table cell content after it was parsed. In some cases it won't matter, in some it does.
Related areas:
- parsing process
- certain thresholds, variable values
- don't run certain functions (e.g. maybe they crash for a certain file cause features are not supported)
- ...
- data enrichment afterwards
- format table content
- handle attachments or pictures
- ...
Implementation sketch: Use a config object which gets passed to the parser. Its values will be passed to certain functions along the parsing process to override default values or do activate/deactivate PDFParser features/methods.
Would that be helpful? What do you think?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the PDFParser parsing process and PDFObject values such as font_space, along with the related issues and pull request discussion linked in the description. Clarify which thresholds, feature toggles, and post-processing behaviors belong in the proposed config object; done requires an agreed design before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100