With xlwt, How do I set my page/paper size to be "letter" or 8.5X11 instead of A4?

StackOverflow https://stackoverflow.com/questions/19054512

  •  29-06-2022
  •  | 
  •  

Question

Title basically explains it, but I can't for the life of me get away from the A4 page size and I am having to resize each file individually. I have a LOT of files. Nearly 2000 now, and its kinda getting old.

Thank you to anyone who helps in advance!

Was it helpful?

Solution

sheet.paper_size_code = 1

is what you want.

example:

    book = Workbook()
    sheet = book.add_sheet('2013')

    sheet.paper_size_code = 1

    sales_units(OUTPUT, header_list, DATE, book, sheet)
    book.save('Projections.xls')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top