I have an image in header.jpeg
I want to set that image as a header to an excel file.
I am using modules pandas, numpy and xlsxwriter
the code looks like this
image_file = open('header.jpeg', 'rb')
image_data = xlsxwriter.compatibility.BytesIO(image_file.read())
worksheet.set_header('&C&G', {'image_center': 'header.jpeg','image_data_left': image_data})
It also works with just
worksheet.set_header('&C&G', {'image_center': 'header.jpeg'})
How can I resize the image in the header, let's say its height by 80%?
accoring to docs I have found that I can use
http://xlsxwriter.readthedocs.io/page_setup.html
The available options are:
margin: (float) Header margin in inches. Defaults to 0.3 inch. image_left: (string) The path to the image. Needs &G placeholder. image_center: (string) Same as above. image_right: (string) Same as above. image_data_left: (BytesIO) A byte stream of the image data. image_data_center: (BytesIO) Same as above. image_data_right: (BytesIO) Same as above. scale_with_doc: (boolean) Scale header with document. Defaults to True. align_with_margins: (boolean) Align header to margins. Defaults to True.
Thanks