Comments (4)
Sorry about the late response....
You can also pass a callback:
var officegen = require('officegen');
var pptx = officegen ({
'type': 'pptx', // or 'xlsx', etc
'onend': function ( written ) {
console.log ( 'Finish to create a PowerPoint file.\nTotal bytes
created: ' + written + '\n' );
},
'onerr': function ( err ) {
console.log ( err );
}
});
On Wed, Oct 23, 2013 at 7:59 PM, Seth Pollack [email protected]:
Right now i have to listen on the finalize event to know when a pptx has
been written out. it would be great to be able to pass a callback instead
to generate. The reason is that i'm writing using streamline (
https://github.com/Sage/streamlinejs) and it doesn't mesh well with event
emitters. I wrote a wrapper for now that listens for the events, and maps
it into a callback.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/7
.
from officegen.
Thanks, i did see that. The issue is that the lifecycle is a bit atypical here. I call var pptx = officegen (...)
, which returns synchronously, then i do arbitrary work to build all my slides, then only when i call pptx.generate(...)
does the onend callback from that first call fire (asynchronously). typically this callback would be associated with the generate call, since that is where the async work happens, not the officegen call. If it was set up that way, it would be a smoother integration for me.
That said, i've already written a wrapper, so this is low priority, you can fix or close as you see fit ;-) Thanks!
from officegen.
Please use the last commit, you can now pass the finalize callback to generate()
from officegen.
great, thanks!
from officegen.
Related Issues (20)
- When generating a new document for the second time, why open the path of the picture in the last generated document
- 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可以转换?
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.