2017-04-20 3 views
0

Ich verwende jsreport mit NodeJS auf Mac und ich bekomme die folgenden Fehlerjsreport: Fehler aufgetreten - Fehler beim Bericht mac Rendering

es bereits geändert Ordner-Berechtigungen und lief als root, aber es funktioniert nicht. Der Beispielcode buchstäblich es kopiert und direkt https://jsreport.net/learn/pdf-reports-in-nodejs

server.js von der offiziellen Website einfügen

var http = require('http'); 
var jsreport = require('jsreport'); 

http.createServer(function (req, res) { 

    jsreport.render("<h1>Hello world</h1>").then(function(out) { 
    out.stream.pipe(res); 
    }).catch(function(e) {  
    res.end(e.message); 
    }); 

}).listen(1337, '127.0.0.1'); 

Fehler:

Error during rendering report: Command failed: /Users/macbookpro/Downloads/reports/node_modules/phantom-html-to-pdf/node_modules/phantomjs/lib/phantom/bin/phantomjs --ignore-ssl-errors=yes --web-security=false --ssl-protocol=any /Users/macbookpro/Downloads/reports/node_modules/phantom-html-to-pdf/lib/scripts/standaloneScript.js /var/folders/0f/6nfvtgxn069237lpmp00ldvr0000gn/T/jsreport/ee4b46e0-261c-11e7-a041-db0530c5a883settings.html 

Error

Antwort

2

Der Standard [email protected] derzeit doesn Arbeiten Sie nicht auf dem MacOS Sierra Update, müssen Sie die Phantomjs 2.

verwenden

https://jsreport.net/learn/phantom-pdf#phantomjs2

The recipe default installation uses [email protected] You can additionally install other versions and use them in parallel.

  1. Install additional phantomjs using npm install phantomjs-exact-2-1-1
  2. Use jsreport studio to switch phantomjs version in properties or set "template.phantom.phantomjsVersion":"2.1.1" in api call

You can also set the default phantomjs version globally in the config:

"phantom": { 
    "defaultPhantomjsVersion": "2.1.1" 
} 

Note that phantomjs 2 produces different sizes of fonts. Also it doesn't support repeating thead when the table spawns multiple pages.

Verwandte Themen