Improve DOCX layout for floating images, drop caps, and footnotes - #2
Improve DOCX layout for floating images, drop caps, and footnotes#2peterwilli wants to merge 2 commits into
Conversation
Add richer paragraph reflow so anchored images render on the correct page, wrap text across nearby paragraphs, and use visible PNG bounds for tighter square wrapping; also add drop-cap/footnote-aware pagination and supporting OOXML parsing updates.
|
Sorry for the long silence on this one. The before and after renders are convincing and I do want the feature. The branch has drifted from main since March, and there are three things that need your hand before it can land.
There is also a conflict on One design note while you are in there. No rush. Give me a shout when it is rebased and I will get to it quickly this time. |
|
Thank you for this, and sorry it sat open so long. Your before and after renders were right, and they stayed right. Everything this PR set out to fix was genuinely broken, and it is fixed now. What I could not do was merge the branch itself, so I want to be clear about what happened to the work. Why it could not be merged directlyThe branch was cut in March, and The rest of the PR was still missing from What shipped, and whereReleased today in rdocx v0.7.0 and rpptx-v0.3.0.
Your What I did not take, and whyIn fairness, three changes were left out on purpose rather than overlooked.
I also did not take the alpha-channel scan for wrap extents. It decoded every image and walked every pixel inside layout with no cache, and it applied outline extents to Still openDrop caps are not implemented. That part of your PR is the one piece with no equivalent on Closing this as superseded. The work is not: thank you for finding all of it, and for the renders that made it obvious. |
|
Superseded by S41 and S42, released in rdocx v0.7.0 and rpptx-v0.3.0. Details in the comment above. |
|
@mantissaman thanks for the wonderful explanation! |

The current library lacks proper render capabilities for images and footnotes. Also added some missing features from the format.
To demonstrate, I used this sample docx: https://filesamples.com/samples/document/docx/sample1.docx
Here is page 5 before the PR:
Here is the same page, but after this PR:
Here is page 7 before this PR:
Here is page 7 after: