Test PDF

 avatar
unknown
python
2 years ago
1.6 kB
7
Indexable

from Zombies import ParsePDF, CEETemplate

testDD = '/home/juan/Descargas/Etiqueta RCE-1E_13011_D_D.pdf'
testGG = '/home/juan/Descargas/Etiqueta RCE-1E_59217_G_G.pdf'
testAA = '/home/juan/Descargas/Etiqueta RCE-1E_04464_A_A.pdf'
testEF = '/home/juan/Descargas/Etiqueta RCE-1E_134540_E_F.pdf'


class CastillaMancha(CEETemplate):

    ccaa = '08'

    keys = {
        'normativa_vigente': {'h': 38.129999999999995, 'w': 180.35},
        'referencia_catastral': {'h': 16.779999999999973, 'w': 180.35},
        'tipo_edificio': {'h': 16.00999999999999, 'w': 199.66999999999996},
        'direccion': {'h': 15.830000000000041, 'w': 199.66999999999996},
        'municipio': {'h': 16.200000000000045, 'w': 199.66999999999996},
        'codigo_postal': {'h': 15.450000000000045, 'w': 199.66999999999996},
        'ccaa': {'h': 16.389999999999986, 'w': 199.66999999999996},
        'consumo': {'h': 0, 'w': 0},
        'emisiones': {'h': 0, 'w': 0},
        'numero_registro': {'h': 45.129999999999995, 'w': 226.8},
        'fecha_validez': {'h': 16.19999999999999, 'w': 193.51}
    }

    maxCoords = {
        'consumo': {
            'h': [33.40, 33.62],
            'w': [82.51, 82.74]
        },
        'emisiones': {
            'h': [31.35, 33.78],
            'w': [82.05000000000001, 82.16000000000003]
        }
    }

certificados = ParsePDF(CastillaMancha)

dd = certificados.parse(testDD)
gg = certificados.parse(testGG)
aa = certificados.parse(testAA)
ef = certificados.parse(testEF)

print("***************")
print(dd)
print(gg)
print(aa)
print(ef)
print("***************")
Editor is loading...