master
bel 2023-02-21 11:54:28 -07:00
parent f54dbfbeec
commit c22168c565
1 changed files with 9 additions and 10 deletions

19
main.py
View File

@ -20,16 +20,15 @@ def de_column_ify():
for i in range(len(pdf.pages)):
log("getting", i, "of", len(pdf.pages))
got = q.get()
debug.draw_boxes(got[0] , [
{
"x0": i.chars[0]["x0"],
"x1": i.chars[0]["x1"],
"y0": i.chars[0]["y0"],
"y1": i.chars[0]["y1"],
"debug_label": i.n,
}
for i in got[1] if i.chars
])
for got_i in got[1]:
if got_i.chars:
debug.draw_boxes(got_i.page, [{
"x0": got_i.chars[0]["x0"],
"x1": got_i.chars[0]["x1"],
"y0": got_i.chars[0]["y0"],
"y1": got_i.chars[0]["y1"],
"debug_label": got_i.n,
}])
def de_columnify_page(q, page):
result = cluster.Chars(page.chars, page).divide_into_columns()