Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picture tag in content control is written without a namespase in output word document #183

Closed
MajedDH opened this issue Mar 1, 2019 · 0 comments

Comments

@MajedDH
Copy link

MajedDH commented Mar 1, 2019

I'm using NPOI from NuGet v2.4.1 and MS Word 2019.

here is the files I used to reproduce the bug: INPUT.docx OUTPUT.docx

I've almost done nothing:
1- Open a new blank document.
2- Go to developer tab and insert a new picture content control
3- Save the file somewhere (no special options just a name).

I've used this basic code:

Stream _templateFileStream= new FileStream(@"INPUT.docx", FileMode.Open, FileAccess.Read);
_document = new XWPFDocument(_templateFileStream);
_document.Write(new FileStream("OUTPUT.docx", FileMode.CreateNew));
_document.Close();

when the output didn't open by ms word i used Open XML SDK 2.5 Productivity Tool For Microsoft Office : here are the validation output:

image

I wonder why it got written without a namespace. When I repeated the same steps but using an image inside the content control , it didn't work. It worked when I inserted a picture (just a very normal picture the normal way without any content controls) and it worked.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants