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

can not support doc? #451

Open
Charltsing opened this issue Feb 8, 2023 · 3 comments
Open

can not support doc? #451

Charltsing opened this issue Feb 8, 2023 · 3 comments

Comments

@Charltsing
Copy link

Charltsing commented Feb 8, 2023

i test a docx with only 3 pictures

using (var document = DocX.Create(docpath))
            {
                foreach (var section in document.Sections)
                {
                    foreach (var paragraph in section.Paragraphs)
                    {
                        foreach (var pic in paragraph.Pictures)
                        {
                            //
                        }
                    }
                }
            }

but Sections.count=1, Paragraphs.count=0, document.Pictures.count=0, so i can not read picture.
can you help me?

spire.doc works fine

@XceedBoucherS
Copy link
Collaborator

Hi,

By reading the code you submitted, I can see you are creating a docx and then trying to parse the sections/paragraphs/Pictures.
But if you create a docx, it will be empty, so it's normal that it contains only 1 section, along with no paragraph/picture.

Thank you

@Charltsing
Copy link
Author

sorry, i make a mistake

docx can not support doc format? docx is fine

@Charltsing Charltsing changed the title pictures.count=0 can not support doc? Feb 10, 2023
@XceedBoucherS
Copy link
Collaborator

Hi
DocX supports MS Word docx format.
It can support MS Word doc format, but it's not garanteed.
Thank you

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

No branches or pull requests

2 participants