npoi icon indicating copy to clipboard operation
npoi copied to clipboard

Add more image wrapping support

Open Zt-freak opened this issue 2 years ago • 2 comments

When using an existing document as a template, not all types of image text wrapping get correctly added to a new generated document. This will lead to the following message from Word:

image

The document is still able to be opened when repaired.

To clarify, these are what I mean with image text wrapping:

image

Zt-freak avatar Dec 01 '22 09:12 Zt-freak

I think this issue was fixed in #504.

Which NPOI version are you using? Can you provide the word document to help reproduce the issue?

tonyqus avatar Dec 01 '22 18:12 tonyqus

This is in NPOI 2.6.0

This is an example document https://github.com/Zt-freak/npoi/blob/master/ExampleForTony.docx

Zt-freak avatar Dec 02 '22 11:12 Zt-freak

The major problem happens in header1.xml

ct_wrapTight is not implemented in NPOI so far

					<wp:wrapTight wrapText="bothSides">
						<wp:wrapPolygon edited="0">
							<wp:start x="4922" y="0"/>
							<wp:lineTo x="0" y="3281"/>
							<wp:lineTo x="0" y="17225"/>
							<wp:lineTo x="4922" y="20506"/>
							<wp:lineTo x="15585" y="20506"/>
							<wp:lineTo x="20506" y="17225"/>
							<wp:lineTo x="20506" y="3281"/>
							<wp:lineTo x="15585" y="0"/>
							<wp:lineTo x="4922" y="0"/>
						</wp:wrapPolygon>
					</wp:wrapTight>

This wp14:sizeRelH is a new tag from new openxml

<wp14:sizeRelH relativeFrom="margin">
						<wp14:pctWidth>0</wp14:pctWidth>
					</wp14:sizeRelH>

tonyqus avatar May 04 '24 06:05 tonyqus