Skip to content

Instantly share code, notes, and snippets.

@rafabn
Created August 18, 2009 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafabn/169819 to your computer and use it in GitHub Desktop.
Save rafabn/169819 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
names: ["pdf", "url2pdf"],
icon: "http://www.adobe.com/lib/com.adobe/template/icon/pdf.gif",
description: "Print web page to pdf.",
help: "Select a url then print it to pdf.",
author: {name: "Rafael Bezerra", email: "rafabn+ubiquity@gmail.com"},
license: "GPL",
homepage: "http://labs.mozilla.com/",
arguments: [{role: 'object', nountype: noun_arb_text}],
preview: function preview(pblock, args) {
pblock.innerHTML = "Send to pdf this <b>" + args.object.html + "</b> web page.";
},
execute: function savePageToPDF(args) {
var pURL = "http://savepageaspdf.pdfonline.com/pdfonline/pdfonline.asp?cURL=" + args.object.text;
Utils.openUrlInBrowser(pURL);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment