copy_worksheet does not copy PageMargins

Issue #1244 new
John Woltman created an issue

In version 2.6 (and, as of this report, 3.0) the copy_worksheet method does not include the PageMargins when copying. I would expect copying a worksheet to include copying the margins as well. I committed a fix at https://bitbucket.org/johnwoltman/openpyxl/commits/b944359cfec740a3f07858596d37747f8e7b1600 and can submit a pull request if it's wanted.

Comments (2)

  1. CharlieC

    Yes, please do submit a PR. You might want to consider what other properties might be worth copying, though it's worth noting that these are all a matter opinion.

    I thought the copier had been documented so that users know what to expect but it appears I'm mistaken.

  2. John Woltman reporter

    I looked into it some more and added the other print-related properties (PrintOptions and PrintPageSetup). This fulfills my particular use case, which is using openpyxl to generate spreadsheets that eventually get turned into PDFs. See pull request #330.

  3. Log in to comment