You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set CT_Anchor.simplePos to an instance of CT_Point2D
This will create a tag: <a:simplePos x="0" y="0" />
as child of the anchor tag.
Issue Description
The modified document can not be opened by word. If manually editing the tag to this: <wp:simplePos x="0" y="0" />
word will be able to open and display the document.
I assume that this a tag should be a wp tag instead, but i am not a docx expert.
Here is the NPOI code line that would need the change from a to wp:
I tried to circumvent the issue by setting simplePos to null, which generates the anchor without the tag. However, this will also not be accepted by word.
This means that effectively it is not possible to anchor a drawing with NPOI, potentially other elements as well.
The text was updated successfully, but these errors were encountered:
I noticed the file with the problem was generated with Xsd2Code, so it might be better to regenerate the file and ensure the source is correct. Otherwise this change would risk being overwritten next time the file is regenerated.
I used OpenXml to fix this issue in post for my generated documents and can confirm that it also create a wp-tag, not "a". Question is why it was generated this way by the tool.
I could create a PR for the one-line change, if you still think that it makes sense to do so. But I do not know how to use Xsd2Code.
NPOI Version
2.7.2
File Type
Reproduce Steps
This will create a tag:
<a:simplePos x="0" y="0" />
as child of the anchor tag.
Issue Description
The modified document can not be opened by word. If manually editing the tag to this:
<wp:simplePos x="0" y="0" />
word will be able to open and display the document.
I assume that this a tag should be a wp tag instead, but i am not a docx expert.
Here is the NPOI code line that would need the change from a to wp:
npoi/OpenXmlFormats/Drawing/BaseTypes.cs
Line 274 in af9bd4f
I tried to circumvent the issue by setting simplePos to null, which generates the anchor without the tag. However, this will also not be accepted by word.
This means that effectively it is not possible to anchor a drawing with NPOI, potentially other elements as well.
The text was updated successfully, but these errors were encountered: