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

Pptx 1.x #95

Merged
merged 3 commits into from
Oct 22, 2014
Merged

Pptx 1.x #95

merged 3 commits into from
Oct 22, 2014

Conversation

tdonia
Copy link
Contributor

@tdonia tdonia commented Oct 21, 2014

Ok, redux. Now based on the 1.1 branch with a regex for slide searching

Feedback appreciated!

var docx = require('docxtemplater');

var fs = require('fs');
content=fs.readFileSync(__dirname+"/CM-Template-double.pptx","binary")
doc=new docx.PptxGen(content);
doc.setData({
  "first_name":"Hipp",
  "last_name":"Edgar",
  "phone":"0652455478",
  "description":"New Website"
})
doc.render()
zip=doc.getZip()

var output = zip.generate({type:"arraybuffer"}),
    buffer = new Buffer(output.byteLength);

for (var i = 0; i < buffer.length; ++i) {
    buffer[i] = output[i];
}
fs.writeFileSync(__dirname + "/output.pptx", buffer);

edi9999 added a commit that referenced this pull request Oct 22, 2014
@edi9999 edi9999 merged commit cb009ff into open-xml-templating:1.x Oct 22, 2014
@edi9999
Copy link
Member

edi9999 commented Oct 22, 2014

Seems great to me. Nice Pull request !

The only thing I'm maybe going to change is the interface, eg the index.coffee but you couldn't do it better I think

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

Successfully merging this pull request may close these issues.

3 participants