raulbojalil / docx-builder Goto Github PK
View Code? Open in Web Editor NEWNPM Module for creating or merging .docx files
NPM Module for creating or merging .docx files
Please add a license to this project :)
Hi,
I'm trying to merge a single document with the "insertDocxSync" function and the merge seems to mess with my tables format (and font).
Here's the code :
let builder = require('docx-builder')
var docx = new builder.Document();
docx.insertDocxSync(__dirname + '/Test/test.docx');
docx.save(__dirname + "/Test/output.docx", function (err) {
if (err) console.log(err);
console.log('done');
});
and here is my test file :
test.docx
and my output file :
output.docx
I am using word 2013, Windows 10 x64 and node v6.11.2<
Thanks! :)
Hi @raulbojalil, I didn't know if you saw that comment after you closed #2 , so i created this new issue :
I ran into two small issues that concerns sections breaks and columns :
And when i inspect the generated document.xml file, there are 2 closing xml tags missing at the very end (plus the content is missing (I guess the two are related)):
Here's the test file :
test.docx
And the obtained result :
result.docx
Here's the test file :
test.docx
And the result :
result.docx
And here's what i found while investigating this issue :
Hopefully this will help :)
013.docx
When I try to merge this file this error appears:
TypeError: Cannot read property '_data' of null
at exports.Document.getExternalDocxRawXml (/*****/node/node_modules/docx-builder/index.js:293:28)
at exports.Document.insertDocxSync (/*****/node/node_modules/docx-builder/index.js:314:18)
Hi @raulbojalil, hope you're doing well!
I ran into this issue while trying to merge a document which contains a section break with a page layout change (one page with vertical layout, the next one with horizontal layout) into an empty builder.document().
Here's my sample code :
var builder = require('docx-builder')
var docx = new builder.Document()
docx.insertDocxSync(__dirname + '/test.docx')
docx.save(__dirname + '/result.docx', function(err) {
if (err) console.log(err)
})
and the test file :
test.docx
Here's the result file :
result.docx
and here's what I obtain when I open the result.docx document :
Thanks for your help!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.