In [ ]:
from odt_parse import OdtData
from odt_diff import find_style_by_name, find_heading_by_text, find_par_by_text
In [ ]:
ref = OdtData('../PDF2ODT/libro_08_con_imagenes.odt',
#ref = OdtData('libro_paginado.odt',
#ref = OdtData('libro_personalizados.odt',
#ref = OdtData('libro_predefinidos.odt',
#ref = OdtData('libro_modificado.odt',
par_prop=['backgroundcolor', 'textalign', 'breakbefore',
'margintop', 'marginbottom', 'marginleft', 'marginright'],
text_prop=['fontsize', 'fontstyle', 'language'],
page_prop=['nextstylename', 'pagelayoutname'] )
print('El documento "%s" tiene:' % ref.filename)
print('\t%3d títulos de los cuales %d están vacíos' % (len(ref.H), ref.emptyHeadings))
print('\t%3d párrafos de los cuales %d están vacíos' % (len(ref.P), ref.emptyPars))
print('\t%3d estilos de párrafo de los cuales %d son de formato directo' % (len(ref.style['paragraph']),
ref.directFormat))
In [ ]:
find_style_by_name(ref.style['page'], 'Portada')
In [ ]:
find_style_by_name(ref.style['page'], 'Página normal')
In [ ]:
find_style_by_name(ref.style['paragraph'], 'Párrafo')
In [ ]:
find_style_by_name(ref.style['paragraph'], 'Heading_1')
In [ ]:
find_style_by_name(ref.style['paragraph'], 'Nota')
In [ ]:
find_style_by_name(ref.style['paragraph'], 'Cita_en_inglés')
In [ ]:
find_style_by_name(ref.style['paragraph'], 'Autor_de_cita')
In [ ]:
find_style_by_name(ref.style['paragraph'], 'Quotations')
In [ ]:
ref.meta
In [ ]:
ref.stat
In [ ]:
ref.style
In [ ]:
ref.H
In [ ]:
find_heading_by_text(ref.H, '2.4.1')
In [ ]:
ref.P
In [ ]: