fix/adding the missing slide size argument in the handle pictures in the mspowerpoint_backend.py file and adding generate=True in the verify export method in the pytest for pptx to ensure the pytest passes appropriately Signed-off-by: Franck Benichou franck.benichou@sciencespo.fr

Signed-off-by: Benichou <fbenichou@deloitte.ca>
This commit is contained in:
Benichou 2025-05-13 20:34:56 -04:00
parent 30cfaaf39f
commit a5e8c2d1be
2 changed files with 4 additions and 4 deletions

View File

@ -416,9 +416,9 @@ class MsPowerpointDocumentBackend(DeclarativeDocumentBackend, PaginatedDocumentB
if shape.shape_type == MSO_SHAPE_TYPE.PICTURE:
# Handle Pictures
drawing_blip = self.xpath_expr(shape.element)
if drawing_blip: # ensure there is a drwaing blip
if drawing_blip: # ensure there is a drawing blip
self.handle_pictures(
shape, parent_slide, slide_ind, doc, drawing_blip, slide
shape, parent_slide, slide_ind, doc, slide_size, drawing_blip, slide
)
# If shape doesn't have any text, move on to the next shape
if not hasattr(shape, "text"):

View File

@ -45,13 +45,13 @@ def test_e2e_pptx_conversions():
doc: DoclingDocument = conv_result.document
pred_md: str = doc.export_to_markdown()
assert verify_export(pred_md, str(gt_path) + ".md"), "export to md"
assert verify_export(pred_md, str(gt_path) + ".md", generate=True), "export to md"
pred_itxt: str = doc._export_to_indented_text(
max_text_len=70, explicit_tables=False
)
assert verify_export(
pred_itxt, str(gt_path) + ".itxt"
pred_itxt, str(gt_path) + ".itxt", generate=True
), "export to indented-text"
assert verify_document(