Havvy
Havvy

Reputation: 1511

xlwt - Print Range Settings

Summary: How do I set the print range settings from xlwt?

I have a document that is currently set as four pages for the purposes of printing, and I need to make it so that the print range is set to only treat it as one page. The documentation for xlwt (outside of the basics) is hard to find.

The only things I've been able to find so far are:

Upvotes: 7

Views: 2597

Answers (1)

pandita
pandita

Reputation: 4989

Try

worksheet.fit_num_pages=1

Or worksheet.set_fit_num_pages(1) both of which shrinks everything to fit on one page. The default value is set to 0 meaning no scaling happens.

ws.print_scaling is a scaling percentage, set by default to 100.

ws.paper_size_code defaults to 9 on my system, but presumably lets you choose between A3, A4, ...

Upvotes: 4

Related Questions