예제 #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')))
예제 #2
0
def given_image_filename(context, filename):
    context.image_path = test_file_path(filename)
예제 #3
0
파일: api.py 프로젝트: AEliu/python-docx
def when_add_picture_specifying_only_image_file(context):
    document = context.document
    context.picture = document.add_picture(test_file_path('monty-truth.png'))
예제 #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)
예제 #5
0
파일: api.py 프로젝트: AEliu/python-docx
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)
    )
예제 #6
0
파일: shape.py 프로젝트: AEliu/python-docx
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')
    ))
예제 #7
0
파일: shape.py 프로젝트: AEliu/python-docx
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)
예제 #8
0
파일: api.py 프로젝트: robline/python-docx
def when_add_picture_specifying_only_image_file(context):
    document = context.document
    context.picture = document.add_picture(test_file_path('monty-truth.png'))
예제 #9
0
파일: api.py 프로젝트: robline/python-docx
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))