VikParuchuri / marker

Convert PDF to markdown quickly with high accuracy
https://www.datalab.to
GNU General Public License v3.0
16.77k stars 953 forks source link

Is there a way to restrict the areas of a page that are read? #193

Open tpanza opened 3 months ago

tpanza commented 3 months ago

I am having to process a large PDF document. It has some logos, boilerplate text, and other useless text in the top, bottom, left, and right margins of every page.

The model(s) seem to be struggling with recognizing these and turning them into Markdown text. It results in random gobbledygook at every PDF page boundary in the resulting Markdown file.

Might there be a way to pass in some settings so that these margin areas are ignored? I took at look in the settings.py (https://github.com/VikParuchuri/marker/blob/master/marker/settings.py) but didn't see anything about that.

I see on the README, "Removes headers/footers/other artifacts", but how do I control/tweak that?

luc42ei commented 3 months ago

yep, would be great to have that. in my case, I'd like to EXPAND THE AREA such that certain headers/footers are actually included because now they are omitted while containing important headings (e.g. of tables)

luc42ei commented 3 months ago

actually, one can expand the area by changing the BAD_SPAN_TYPES parameter in the settings.py file. it seems like removing all elements there would imply expanding the area to 100%