Docx: addSection function always creates a new page.

Created on 24 Jun 2019  路  5Comments  路  Source: dolanmiu/docx

Whenever we call the function addSection() a new page is getting created and then the content goes in this new page that is created.
Ideally, the section should get created on the same page.
I think Issue #327 is also related to this.

All 5 comments

Hmm may need investigation or re-design of that API

Hmm may need investigation or re-design of that API

I added this and I can now have multiple sections in the same page
{ "w:type": { _attr: { "w:val": "continuous" } } }

the attribute "continuous" made it work

@zahrafali would you care to elaborate on your solution? How do I make it work?

So addSection() still adds it's content to a new page. Zahrafali's solution looks to be a change in the API. Will this make it into the release, despite her pull request being closed?

@theocarranza Like @jamesdefant says it is a change in the API. The pull request is closed because I made the changes to the forked repo. I probably created the pull request by mistake, apologies for that.

If you're using the new, updated version of docxjs, then you may consider creating a pull request according to the newer code style.

I added the property 'type' and if you want the section on the same page then you can set 'type' to continuous.

Was this page helpful?
0 / 5 - 0 ratings