Exemple #1
0
def when_add_inline_picture_to_document(context):
    document = context.document
    context.inline_shape = (document.inline_shapes.add_picture(
        test_file_path('monty-truth.png')))
Exemple #2
0
def given_image_filename(context, filename):
    context.image_path = test_file_path(filename)
Exemple #3
0
def when_add_picture_specifying_only_image_file(context):
    document = context.document
    context.picture = document.add_picture(test_file_path('monty-truth.png'))
Exemple #4
0
def when_add_inline_picture_from_file_like_object(context):
    document = context.document
    with open(test_file_path('monty-truth.png'), 'rb') as f:
        context.inline_shape = document.inline_shapes.add_picture(f)
Exemple #5
0
def when_add_picture_specifying_width(context):
    document = context.document
    context.picture = document.add_picture(
        test_file_path('monty-truth.png'), width=Inches(1.5)
    )
Exemple #6
0
def when_add_inline_picture_to_document(context):
    document = context.document
    context.inline_shape = (document.inline_shapes.add_picture(
        test_file_path('monty-truth.png')
    ))
Exemple #7
0
def when_add_inline_picture_from_file_like_object(context):
    document = context.document
    with open(test_file_path('monty-truth.png'), 'rb') as f:
        context.inline_shape = document.inline_shapes.add_picture(f)
Exemple #8
0
def when_add_picture_specifying_only_image_file(context):
    document = context.document
    context.picture = document.add_picture(test_file_path('monty-truth.png'))
Exemple #9
0
def when_add_picture_specifying_width(context):
    document = context.document
    context.picture = document.add_picture(test_file_path('monty-truth.png'),
                                           width=Inches(1.5))