Unexisting spaces being identified within words
Hello
I am trying to extract data from this file: page.pdf
I am using the python wrapper:
import tabula
tabula.__version__
'1.3.0'
When I run this code:
from tabule import wrapper
df = wrapper.read_pdf('/tmp/page.pdf', spreadsheet=True, encoding='utf8')
print(df)
I get:
Município ... Seções 0 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 1, 2, 3, 4, 5, 6,... 1 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 105, 107, 130, 149 2 AFONSO\rCLÁUDIO ... S e ç õ es da 8a Zona Eleitoral: 106 3 AFONSO\rCLÁUDIO ... S e ç õ e s da 8a Zona Eleitoral: 137, 139... 4 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 16, 17, 18, 19, 2... 5 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 22, 23, 27, 100, ... 6 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 24, 25, 26, 94, 9... 7 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 28, 29 8 AFONSO\rCLÁUDIO ... S e ç õ e s da 8a Zona Eleitoral: 30, 3... 9 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 34, 35, 36, 37, 1... 10 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 38, 39, 40, 41, 4... 11 AFONSO\rCLÁUDIO ... S e ç õ e s da 8a Zona Eleitoral: 57, 58, 59 12 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 64, 65, 66, 67, 128 13 AFONSO\rCLÁUDIO ... Seções da 8a Zona Eleitoral: 68, 69, 92, 104
Some words, like "seções" appear with some spaces that do not exist. When I use PyPDF2, to extract the text, these spaces do not appear (I am not using PyPDF only because it only gives me the raw string). Is there something I can do to change how tabula detect these spaces?
could it depend on the encoding? are you sure that "utf8" is correct?
Same issue with this PDF: http://spmi.ru/sites/default/files/raspisanie/1%20курс%20НГ%2C%20ГР%20(гот).pdf Encoded as UTF-8 i presume
I believe it is related to this other one https://github.com/tabulapdf/tabula-java/issues/88