Skip to content

place pageSetUpPr in the end of sheetPr to fix getting broken xlsx do… #2807

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

strelok372
Copy link

@strelok372 strelok372 commented Aug 12, 2024

Summary

Fix for this bug
#1348

Test plan

const workbook = new ExcelJS.Workbook();

workbook.creator = 'Me';

const worksheet = workbook.addWorksheet('My Sheet', {
    pageSetup: {paperSize: 9, orientation: 'landscape', fitToPage: true, fitToHeight: 0}
});

const filename = "result.xlsx"
workbook.xlsx.writeFile(filename);

This code won't work in the 4.4.0 version, you will get an error while opening xlsx file
The problem code is fitToPage: true

Related to source code (for typings update)

inner = this.map.pageSetUpPr.render(xmlStream, model.pageSetup) || inner;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant