I am trying to create a pdf file using the wkhtmltopdf utility.
Problem: pass command in cmd incorrectly (slashes "\" are deleted)
Question: How to pass the command? Tried to screen, apparently doing wrong.
(Below is the code of the executable file)
"use strict";//http://jsman.ru/express/ var http = require('http'), fs = require('fs'), url = require('url'), port = 8080, host = '127.0.0.1', express = require('express'), cmd = require('node-cmd'), path = require('path'), app = express(); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.get('/', function(req, res){res.send(200, "Hello, World")}); app.get('/pdf', function(req, res){ cmd.get( 'cd "C:\Program Files\wkhtmltopdf\bin" | wkhtmltopdf www.yandex.ru C:\Users\amstel\Desktop\yandex.pdf', function(data, err, stderr){ if (!err) { console.log('Done\n',data) } else { console.log('Error\n', err) } } ); }) var server = app.listen(port, host); console.log("Express server running on http://%s:%s", host, port); The result of this code:
Figure 2 (entering two commands does not work at once):


|, and&, and secondly, most likely, you don’t even need to do this, try executing the program right away, withoutcd, just indicating the full path:C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf www.yandex.ru C:\\Users\amstel\\Desktop\\yandex.pdf(Especially since there are surprises withcdif the program is suddenly on another logical drive.) - Yaant