VikParuchuri / marker

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

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

Open tpanza opened 5 months ago

tpanza commented 5 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 5 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 5 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%

svenha commented 1 day ago

@luc42ei In version 1, there is no BAD_SPAN_TYPES anymore. What are you using now?