Answer the question
In order to leave comments, you need to log in
Phantomjs does not want to work with Cyrillic, how to fix it?
The problem is that PhantomJS refuses to recognize Cyrillic.
screen.js file
var page = require('webpage').create();
page.viewportSize = { width: 800, height: 600 };
page.zoomfactor = 1;
page.open('http://seelnk.ru/graphgen/graphgen.php?label=ТЕСТ&data=1,2,3,4,5&labels="1", "2", "3", "4", "5"', {
charset: 'utf-8', // или utf8
}, function(status) {
if (status !== 'success') {
console.log('Unable to load the address!');
phantom.exit();
} else {
window.setTimeout(function () {
console.log('Load the address!');
page.dpi = 300;
page.render('Newpdf.png',{format: 'png', quality: '100'});
phantom.exit();
}, 1000); // Change timeout as required to allow sufficient time
}
//phantom.exit();
});
<?php
$exec = 'phantomjs screen.js';
$escaped_command = escapeshellcmd($exec);
exec($escaped_command);
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question