Skip to content
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

XWPFDocument : line breaks converted to page breaks. #909

Closed
PBrunot opened this issue Aug 15, 2022 · 1 comment
Closed

XWPFDocument : line breaks converted to page breaks. #909

PBrunot opened this issue Aug 15, 2022 · 1 comment

Comments

@PBrunot
Copy link
Contributor

PBrunot commented Aug 15, 2022

Description of the issue

Line breaks without type attribute in the XML file, are converted to Page Breaks by NPOI.

Reproduction of the issue

Opening a Word file, containing line breaks without a defined type attribute (e.g. <w:br />), as generated by Word when typing Shift+Enter , and saving it, is enought to see the issue.

            using var reader = File.OpenRead(cabTemplate.FullName);
            XWPFDocument doc = new XWPFDocument(new FileInputStream(reader));
            
            var dbg = Path.GetRandomFileName();
            using var outstr = File.Create(dbg);
            doc.Write(outstr);
            outstr.Close();
@tonyqus
Copy link
Member

tonyqus commented Aug 15, 2022

Thank you for the PR.

tonyqus added a commit that referenced this issue Aug 15, 2022
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

No branches or pull requests

2 participants