-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
[Word 2007] file cannot be opened in Word 2007 #1113
Comments
Normally I'm using At the current state of docx js does not verify correctness of the file so there are lot of things you can do to have document that is not possible to open. In most cases it is connected to the structure of elements (paragraph into paragraph and such kind of things) The second popular reason for me is the numbering. (I don't remember exact cases now already, but I think it was anything like not correctly matched structure and style names) UPD: I was using newer Word, not sure if that makes any difference for your problem. Not likely I think |
I tried this code Actually, I have set the table width type as "percentage" in the beginning, but it didnt work. After checking my code I found that the WidthType object has the PERCENTAGE property instead of the PCT property. |
This is a demo, it works in Word 2013, but cannot be opened in Word 2007 with a message "Unspecified error". const table = new Table({
width: {
size: 100,
type: WidthType.PERCENTAGE
},
rows: [
new TableRow({
children: [
new TableCell({
children: [new Paragraph("hello")],
}),
],
}),
]
})
const section = {
properties: {
page: {
size: {
orientation: PageOrientation.PORTRAIT
}
}
},
children: [table]
}
const doc = new Document({
sections: [section]
}) |
Interesting stuff, lets see what Dolan says, but this attribute is made exactly according to the standard http://officeopenxml.com/WPtableWidth.php |
Another problem, docx file with image is unable to open in Word 2007. |
I have corrected the documentation, now it correctly has Maybe Word 2007 does not support the pct property? IMO, if its in the official OOXML spec, then it should stay. Maybe have a disclaimer in the documentation explaining the limitations and caveats of |
Yeah, it seems pct is not suported in Word 2007, i use dxa instead, it works. The image problem is not solved yet. 😢 |
Problem:
The docx file cannot be opened in Word 2007 with a tips said "Unspecified error".
After testing several files, I found that the error location is always on this code in /word/document.xml:
<w:tblW w:type="auto" w:w="100%"/>
What I expected:
open the generated docx file in Word 2007
The text was updated successfully, but these errors were encountered: