Comments (9)
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.
I'm also interested in this.
from officegen.
After looking into this further, it seems that addImage
does support passing a stream as the first argument.
from officegen.
+1
from officegen.
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.
Has there been any activity related to this subject? I'm interested in this as well!
from officegen.
+1
from officegen.
+1
from officegen.
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)
- Not Able to embed excel as object via insert option in Word Document
- Node.js Officegen assign color to cell for a generated excel
- Can i open and edit an existing docx or dotx? HOT 2
- How to add plugin? HOT 2
- Documentation HOT 1
- How do I insert an image into a table cell? HOT 3
- how to set header and footer inside docx using officegen HOT 1
- How to make a particular page Orientation to A3 / Landscape ? HOT 2
- How to add Sections in word file with Officegen ? and how to set font size and to make it bold for entire column in a table
- How to set the first line indentation for a paragraph in word?
- Can i remove Header and Footer from First page ( Title Page ) and some more queries
- Why does the table fill color not work?
- Cannot generate word file in render process for one Electron app
- How to add repeat header in table docx
- How to insert image into tableceil in docx
- how to open a word document ?
- Is addImage with svg supported for pptx file?
- How to assign color property to newline in table cell in word document ?
- 如何将word转换html,html里面的style css可以转换?
- Embedded File is still being accessed by createReadStream asynchronously even after deletion in officegen for Word Document
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from officegen.