Phantomjs 在 Azure 网站上呈现黑框 [英] Phantomjs renders black boxes on Azure Websites
问题描述
使用最新的 Phantomjs 二进制文件 v1.9.7在 Azure 网站上,它会呈现黑框而不是字符.
Using latest Phantomjs binaries v1.9.7 on Azure websites, it renders black boxes instead of character.
这是 Azure 上的简单 phantomjs 脚本示例:
here is an example of simple phantomjs script on Azure:
var page = require("webpage").create();
page.content = "Hello 123";
page.render("index.png");
phantom.exit(0);
png 和 pdf 的结果是 [] [] [] [] [] [] [] 黑色
the png and pdf result is [] [] [] [] [] [] [] in black
而 jpg 结果是大黑框
And the jpg result is big black box
这会阻止我们将 phantomJS 用作网络作业和网站内
This prevent us from using phantomJS as a webjob and within websites
注意:phantomjs 在 VM、WebRole 和 WorkerRole 上运行良好
Note : phantomjs is working fine on VM,WebRole and WorkerRole
推荐答案
PhantomJs 使用 Windows 的 GDI+
API 在 PNG 和 PDF 中创建字体和矢量,不幸的是,Azure 网站目前不支持
PhantomJs uses GDI+
APIs from Windows for creating fonts and vectors in PNGs and PDFs which is, unfortunately, not supported currently on Azure Websites
这篇关于Phantomjs 在 Azure 网站上呈现黑框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!