Giter VIP home page Giter VIP logo

Comments (9)

Jensiator avatar Jensiator commented on July 20, 2024 1

This works when adding images to a Powerpoint
var data = image['Data'].replace(/^data:image/\w+;base64,/, "");
var buffer = new Buffer(data, 'base64');
pptSlide.addImage(buffer,{y:yPos,cy:250,cx:250});

from officegen.

jbergknoff avatar jbergknoff commented on July 20, 2024

I'm also interested in this.

from officegen.

jbergknoff avatar jbergknoff commented on July 20, 2024

After looking into this further, it seems that addImage does support passing a stream as the first argument.

from officegen.

danmo avatar danmo commented on July 20, 2024

+1

from officegen.

Ziv-Barber avatar Ziv-Barber commented on July 20, 2024

OK, I can see what I can do.

On Tue, Nov 15, 2016 at 2:32 PM, Dan Ochiana [email protected]
wrote:

+1


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#32 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADf3MfhhSuK72WDnBxzFLwnq_y3gJNbRks5q-bRZgaJpZM4CVeoG
.

from officegen.

benjaminwood avatar benjaminwood commented on July 20, 2024

Has there been any activity related to this subject? I'm interested in this as well!

from officegen.

SeanLMcCullough avatar SeanLMcCullough commented on July 20, 2024

+1

from officegen.

ItamarShDev avatar ItamarShDev commented on July 20, 2024

+1

from officegen.

WilliCommer avatar WilliCommer commented on July 20, 2024

addImage will consume a node stream. This works with PowerPoint and Word.

const stream = require('stream');

function dataUrlImgStream (imgUrl) {
const splitDataUrl = /^data:.+/(.+);base64,(.*)$/;
let matches = imgUrl.match(splitDataUrl);
let data = matches[2];
let buffer = Buffer.from(data, "base64");
let bufferStream = new stream.PassThrough();
bufferStream.end(buffer);
return bufferStream;
}

pObj.addImage( dataUrlImgStream(imgUrl), {cx: 512, cy: 512});

from officegen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.