Comments (5)
@dolanmiu you are correct that <w:br w:type="page"/>
is the right way to create a paragraph break. However, docx currently puts that inside <w:pPr>
which breaks it.
What it looks like now:
<w:p>
<w:pPr>
<w:r>
<w:rPr />
<w:br w:type="page" />
</w:r>
</w:pPr>
</w:p>
What it should look like:
<w:p>
<w:r>
<w:br w:type="page" />
</w:r>
</w:p>
Update: at least, this is the difference between my docx generated file where the page break is unrecognized, and Word-created docx file where the page break is recognized. I can't seem to find anything else, and when I removed the <w:pPr>
from my docx generated file by hand, the page break shows up in Word Online and Pages where I have been testing. This isn't the most scientific approach, apologies, but hopefully it helps.
from docx.
https://web.archive.org/web/20160820235211/http://officeopenxml.com/WPtextSpecialContent-break.php
I followed this documentation when implementing it
you can see that it has <w:br>
with various options for type
, including page
I'm using waybackmachine cos the original website is down (hence im porting it) 😂
from docx.
I have ported the page over:
https://github.com/dolanmiu/Office-Open-XML-Reference/wiki/Paragraph-Line-Break
from docx.
I think you was thinking of the below. Paragraph and Run both have breaks! but they do different things.
https://github.com/dolanmiu/docx/wiki/Text#break
from docx.
This has been fixed in #41. We should be able to close this issue.
from docx.
Related Issues (20)
- Repeat header in row HOT 1
- Attempted import error: 'Packer' is not exported from 'docx' (imported as 'Packer'). HOT 7
- Packer.toBuffer error in browser: nodebuffer not supported by this platform HOT 1
- Lists - instance not working with level greater than 0
- ExternalHyperlink renders empty line HOT 3
- tableHeader repeats row only if declared on the first row in a table
- el.elements not iterable when patching comments
- can not set indent by chars HOT 2
- Adding different numbering within the same line of paragraph HOT 12
- Field Codes in SimpleField Formulas HOT 1
- Corrupt Word document from patching with an XML attribute with an ampersand HOT 3
- After Patching, Following Text is Wrong Font Family HOT 1
- Possibility of adding hanging without affecting left indent of the paragraph.
- `PageNumber.TOTAL_PAGES_IN_SECTION` not documented and not functional, but within TS enum HOT 2
- Colors are not showing properly HOT 2
- When I open a document using WPS office, the width of the table cannot fill the entire page HOT 2
- Add accent characters
- The MathIntergral limLoc seems to be wrong
- Doesn't work with bg-black HOT 1
- Couple issues with embedded fonts HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docx.