我想知道如何在我的操作系统中使用Node-Webkit和PDFKIT打开.pdf.
Node-Webkit应用程序在项目的根目录下创建.pdf,我只想打开并打印它...
var pdf = require('pdfkit');
var fs = require('fs');
( function($){
$(document).ready( function(){
$('#form-quote').on('submit', function(e){
e.preventDefault();
var doc = new pdf();
doc.pipe(fs.createWriteStream('quote.pdf'));
doc.fontSize(20).text("test", 50, 400);
doc.end();
// Open the .pdf here using the operating system of the user
});
});
})(jQuery);
Run Code Online (Sandbox Code Playgroud) 我有一个节点 webkit 应用程序,它使用 mdns 模块从 Mac(使用 Mavericks)发布 Bonjour 服务。当我运行服务器代码时node server.js一切正常,但是当运行使用相同服务器代码的节点 webkit 应用程序时,我收到此错误:
"Uncaught Error: dlopen(/Users/me/myfolder/node_modules/mdns/build/Release/dns_sd_bindings.node, 1): no suitable image found. Did find:
/Users/me/myfolder/node_modules/mdns/build/Release/dns_sd_bindings.node: mach-o, but wrong architecture", source: /Users/me/myfolder/node_modules/mdns/lib/dns_sd.js (35)
Run Code Online (Sandbox Code Playgroud)
显然,当您安装该mdns模块时npm,它是为 x86 架构构建的,而我需要它用于 i386,因为 node-webkit 是为 i386 构建的(我通过阅读此线程发现了这一点: http: //forums.macrumors.com/showthread .php?t=879780 )。您可以通过在终端中运行以下命令来验证它:
$ lipo -info /Applications/node-webkit.app/Contents/MacOS/node-webkit
Non-fat file: /Applications/node-webkit.app/Contents/MacOS/node-webkit is architecture: i386
Run Code Online (Sandbox Code Playgroud)
我发现这个链接建议了一个解决方案:https://github.com/rogerwang/node-webkit/issues/296对于另一个模块(节点代理)。建议的说明是:
I managed to build a 32-bit version of node-proxy as follows:
I installed nw-gyp
I ran nw-gyp configure --target=0.3.6 …Run Code Online (Sandbox Code Playgroud) 我正在动态创建 iframe,并且我想阻止不是源自 iframe 来源的脚本。这甚至可能吗(通过 JavaScript/jQuery)?例如,如果我的页面从example.com内容加载 iframe :
<script src="http://example.com/foo.js"></script>
<script src="http://something-else.com/bar.js"></script>
Run Code Online (Sandbox Code Playgroud)
我希望example.com脚本运行,但我希望something-else.com脚本被阻止而不是运行。
我正在使用NW.js(以前称为 Node-Webkit),所以我对 iframe 的内容有完全的读写访问权限,就好像它们是同源的一样。
我试过使用插件(比如那些在图片中带有 CORS 的插件,带有白名单),但我试过的任何东西都不起作用。
除了 iframe 的来源之外,理想的解决方案还允许我将特定的其他来源列入白名单。
编辑:
这是我的浏览器项目,我试图在:https : //github.com/IdeasNeverCease/Aries
这是 iframe 加载完成的代码部分:https : //github.com/IdeasNeverCease/Aries/blob/master/app.nw/resources/scripts/aries.js#L376-L687
我正在研究要走的路。我需要构建一个良好的结构化方法,以某种方式构建一个框架应用程序,以便其他开发人员可以开始针对它进行编码。
要求: - Web 应用程序(SQL Server) - 桌面应用程序(Sql Lite) - 身份验证 - 尽可能相同的代码库 - 模块化结构 - 持续交付
到目前为止,我使用 NW 作为平台。至于框架,我已经尝试过 Sails,不幸的是,SQLite 将成为 Sails 的一个问题。Sails 使用水线,我不能让它与编译的 SQlite 一起工作。我很想使用 Sails,因为我有使用它的经验。
现在,我在看 NW 和 Express。至少我知道我可以让它与 SQLite 一起工作。
最近我听说了Electron。我有一些关于它的问题。
任何见解都得到了认可。
我来自网络开发世界,对桌面应用程序一无所知.该应用程序使用coffee脚本开发,并通过node-webkit打包.我想知道,如果有一种方法可以检查应用程序中的元素.谷歌搜索时,我来自Adobe AIR和Spark Inspector.但似乎没有任何东西可用于node-webkit应用程序.有没有人对此有任何想法?
我可以使用node-webkit为Android或ios平台开发应用程序吗?如果没有可能存在使用node-webkit为Android或ios平台开发应用程序的可能性?
注意:我已经搜索了这个,并且知道我们现在无法使用node-webkit为android或ios平台开发应用程序.
谢谢
刚刚开始尝试为我的节点webkit应用程序创建一个菜单栏,我直接按照主人Roger Wang自己的说明...在这里:
https://github.com/rogerwang/node-webkit/wiki/Window-menu
这是代码:
var gui = require('nw.gui');
var mb = new gui.Menu({type:"menubar"});
mb.createMacBuiltin("your-app-name");
gui.Window.get().menu = mb;
Run Code Online (Sandbox Code Playgroud)
在Mac上工作得很漂亮,但却使PC应用无法运行.现在有什么想法可以解决吗?
提前致谢.
我正在使用桌面应用程序,Node-webkit
我尝试通过从两个不同的终端/选项卡运行两次gulp来运行它的两个实例.
它在MAC中工作但在尝试在Windows中执行相同时遇到了一些问题
Gulp在Windows中第二次运行时,它出现以下错误:

错误:"无法初始化Web数据库:2"
有什么办法可以在windows中运行nodewebkit的多个实例吗?
提前致谢
我们正在与peerjs(Webrtc)建立视频聊天.我们有一个nodewebkit版本和一个chrome版本.但由于某种原因,如果chrome启动了一个mediawebkit的媒体流,我们在nw中得到了跟随错误.
PeerJS: Creating RTCPeerConnection.
peer.min.js:1 PeerJS: Listening for ICE candidates.
peer.min.js:1 PeerJS: Listening for `negotiationneeded`
peer.min.js:1 PeerJS: Listening for data channel
peer.min.js:1 PeerJS: Listening for remote stream
peerJS: Setting remote description RTCSessionDescription {sdp: "v=0?o=- 2956768960815374026 2 IN IP4 127.0.0.1?s…5525 label:87a9904d-945d-4393-ad98-68be98482104?", type: "offer"}
peer.min.js:1 PeerJS: ERROR Error: Failed to parse SessionDescription. Failed to parse audio codecs correctly.
callingManager.js:293 webrtc:Failed to parse SessionDescription. Failed to parse audio codecs correctly.
peer.min.js:1 PeerJS: Failed to setRemoteDescription, Failed to parse SessionDescription. Failed to parse audio …Run Code Online (Sandbox Code Playgroud) 我正在使用Node Webkit作为我的网络应用程序,我真的是使用node webkit的新手.我想在我的应用程序中运行我的exe,但我甚至无法使用'child_process'打开简单的记事本.我在网站上看到了一些例子,但我发现很难运行notepad.exe,请提前帮助并非常感谢.
var execFile = require
('child_process').execFile, child;
child = execFile('C:\Windows\notepad.exe',
function(error,stdout,stderr) {
if (error) {
console.log(error.stack);
console.log('Error code: '+ error.code);
console.log('Signal received: '+
error.signal);
}
console.log('Child Process stdout: '+ stdout);
console.log('Child Process stderr: '+ stderr);
});
child.on('exit', function (code) {
console.log('Child process exited '+
'with exit code '+ code);
});
Run Code Online (Sandbox Code Playgroud)
此外,我试图使用meadco-neptune插件运行exe并添加插件我把代码放在package.json文件中,但它显示无法加载插件.我的package.json文件是这样的
{
"name": "sample",
"version": "1.0.0",
"description": "",
"main": "index.html",
"window": {
"toolbar": false,
"frame": false,
"resizable": false,
"show": true,
"title": " example"
},
"webkit": {
"plugin": true …Run Code Online (Sandbox Code Playgroud)