Giter VIP home page Giter VIP logo

Comments (11)

pietersv avatar pietersv commented on July 20, 2024

@scorpwarp23 Does the PPT include embedded charts?

from officegen.

scorpwarp23 avatar scorpwarp23 commented on July 20, 2024

Nope. Just images and text. Funny thing is it works on my Ubuntu desktop.
The moment I run it on a VM it never exits

On Friday, June 19, 2015, Pieter Sheth-Voss [email protected]
wrote:

@scorpwarp23 https://github.com/scorpwarp23 Does the PPT include
embedded charts?


Reply to this email directly or view it on GitHub
#64 (comment)
.

Shrenik Kenia
+91-9820520019

from officegen.

pietersv avatar pietersv commented on July 20, 2024

@scorpwarp23 Could you run the following diagnostic? (I don't have an Ubuntu test machine set up yet)
I divided the tests to see if it's generating charts.

If it works for the nocharts but fails for the charts my next question is whether jar is on the path, so try which jar. The embedded charts use jar to zip the contents of embedded xlsx file. The fork this is copied from originally required zip to be on the path, but Heroku only had jar. A better solution is to use pure-JS lib such as jszip.

from officegen.

scorpwarp23 avatar scorpwarp23 commented on July 20, 2024

Here's the output:

Note, it passed both tests. FYI, my issue is fundamentally the same as
#26. Basically all i see is
an 8KB file. Is one of the libraries you're using using some kind of
command line util that is available on my desktop but on the VM by default?

root@demo:~/Temp/officegen# mocha test/test-pptx-nocharts.js

PPTX generator

✓ creates a presentation with properties and text (346ms)

✓ creates slides with shapes (91ms)

✓ creates presentation to widescreen (88ms)

✓ creates slides with images (403ms)

✓ creates a native table (95ms)

5 passing (1s)

root@demo:~/Temp/officegen# mocha test/test-pptx-charts.js

PPTX generator

✓ creates a slides with charts (261ms)

✓ creates a presentation with charts (318ms)

✓ creates a presentation with charts (235ms)

✓ creates a presentation with charts (236ms)

✓ creates a presentation with charts (227ms)

✓ creates a presentation with charts (217ms)

6 passing (2s)

On Fri, Jun 19, 2015 at 7:09 PM, Pieter Sheth-Voss <[email protected]

wrote:

@scorpwarp23 https://github.com/scorpwarp23 Could you run the following
diagnostic? (I don't have an Ubuntu test machine set up yet)
I divided the tests to see if it's generating charts.

If it works for the nocharts but fails for the charts my next question is
whether jar is on the path, so try which jar. The embedded charts use jar
to zip the contents of embedded xlsx file. The fork this is copied from
originally required zip to be on the path, but Heroku only had jar. A
better solution is to use pure-JS lib such as jszip.


Reply to this email directly or view it on GitHub
#64 (comment)
.

Shrenik Kenia
+91-9820520019

from officegen.

pietersv avatar pietersv commented on July 20, 2024

@scorpwarp23 Thanks! The charts do rely on jar being on the path (i.e. the Java Archive tool which creates zip files). It's possible that it's not finding it. On terminal type which jar and in Node try:

var cmd = 'which jar';
var a = exec(cmd, function(err, stdout, stderr) { console.log(stdout, stderr); })

I'm wondering how the tests could yield a false positive. The PowerPoint tests work by

  • generating an output file to the file system, e.g. /tmp/test-ppt-chart0.pptx
  • reading it from the file system
  • unzipping it using jszip
  • reading the contents, specifically two subfiles ppt/slides/slide1.xml and ppt/charts/chart1.xml
  • comparing them as strings to a reference file

If you do a listing of /tmp do you see the generated test files?

from officegen.

pietersv avatar pietersv commented on July 20, 2024

I divided the examples into two files as well:

  • examples/make_pptx.js
  • examples/make_pptx_charts.js

Can you fetch these from the branch and see if one/both work?

from officegen.

scorpwarp23 avatar scorpwarp23 commented on July 20, 2024

Ok I ran this:

var cmd = 'which jar';

var exec = require('child_process').exec;

var a = exec(cmd, function(err, stdout, stderr) { console.log(stdout,
stderr); })

I got /usr/bin/jar

Also as I said before I'm not using charts.

On Fri, Jun 19, 2015 at 8:22 PM, Pieter Sheth-Voss <[email protected]

wrote:

@scorpwarp23 https://github.com/scorpwarp23 Thanks! The charts do rely
on jar being on the path (i.e. the Java Archive tool which creates zip
files). It's possible that it's not finding it. On terminal type which jar
and in Node try:

var cmd = 'which jar';var a = exec(cmd, function(err, stdout, stderr) { console.log(stdout, stderr); })


Reply to this email directly or view it on GitHub
#64 (comment)
.

Shrenik Kenia
+91-9820520019

from officegen.

pietersv avatar pietersv commented on July 20, 2024

Sincere apologies, I misread that as meaning it was generating just the text and images.

from officegen.

scorpwarp23 avatar scorpwarp23 commented on July 20, 2024

Nah. It's generating a 8KB file. Ok now this is funny. When I run the
example it works fine and generates the powerpoint. However, in my code it
is not working (on the server only, works fine on desktop). Could this be a
RangeError or something?

On Fri, Jun 19, 2015 at 8:32 PM, Pieter Sheth-Voss <[email protected]

wrote:

Sincere apologies, I misread that as meaning it was generating just the
text and images.


Reply to this email directly or view it on GitHub
#64 (comment)
.

Shrenik Kenia
+91-9820520019

from officegen.

scorpwarp23 avatar scorpwarp23 commented on July 20, 2024

That 8KB file is incomplete. Basically finalise is never reached. I meant
to say the example works on the server as well as the desktop. But my code
does not throw any errors but still generate's finalise event is never
reached. Also could it be something about pptx writing a stream rather than
a buffer. Cause the approximately 8KB file (8006 bytes) makes me think this
is a buffer / stream issue.

On Fri, Jun 19, 2015 at 8:33 PM, Shrenik Kenia [email protected]
wrote:

Nah. It's generating a 8KB file. Ok now this is funny. When I run the
example it works fine and generates the powerpoint. However, in my code it
is not working (on the server only, works fine on desktop). Could this be a
RangeError or something?

On Fri, Jun 19, 2015 at 8:32 PM, Pieter Sheth-Voss <
[email protected]> wrote:

Sincere apologies, I misread that as meaning it was generating just the
text and images.


Reply to this email directly or view it on GitHub
#64 (comment)
.

Shrenik Kenia
+91-9820520019

Shrenik Kenia
+91-9820520019

from officegen.

scorpwarp23 avatar scorpwarp23 commented on July 20, 2024

Hey really sorry for the trouble. So I managed to fix the issue. It was a
bug on my part - was calling the add text method with a variable that was
broken. Strange thing is it never threw me an error. Guess you need an
update there - if add text is passed null or undefined.
On 19-Jun-2015 20:36, "Shrenik Kenia" [email protected] wrote:

That 8KB file is incomplete. Basically finalise is never reached. I meant
to say the example works on the server as well as the desktop. But my code
does not throw any errors but still generate's finalise event is never
reached. Also could it be something about pptx writing a stream rather than
a buffer. Cause the approximately 8KB file (8006 bytes) makes me think this
is a buffer / stream issue.

On Fri, Jun 19, 2015 at 8:33 PM, Shrenik Kenia [email protected]
wrote:

Nah. It's generating a 8KB file. Ok now this is funny. When I run the
example it works fine and generates the powerpoint. However, in my code it
is not working (on the server only, works fine on desktop). Could this be a
RangeError or something?

On Fri, Jun 19, 2015 at 8:32 PM, Pieter Sheth-Voss <
[email protected]> wrote:

Sincere apologies, I misread that as meaning it was generating just the
text and images.


Reply to this email directly or view it on GitHub
#64 (comment)
.

Shrenik Kenia
+91-9820520019

Shrenik Kenia
+91-9820520019

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.