NodeJS - PDF generate from URL - node.js

Wanted to generate a PDF from a URL
(https://10.1.40.117/print/e71b7c0f-4ed1-4d0d-b868-87418d398a4a).
Please help me with the links which is used to do this using nodeJS

I use Puppeteer to generate PDFs and their documentation has many examples. Since it uses Chrom(e|ium), it closes match my development environment as well which is nice when building the web pages.

For those who might stumble on this question nowadays:
There is cool tool called Gotenberg — Docker-powered stateless API for converting HTML, Markdown and Office documents to PDF. It supports converting URLs via Google Chrome headless.
And I am happen to be an author of JS/TS client for Gotenberg — gotenberg-js-client
I welcome you to use it :)
UPD:
Gotenberg has new website now — https://gotenberg.dev

Related

detecting if website has e-commerce in Node.js

I need to detect programatically if a website has an e-commerce platform/system
I don't need to know which one, I just need to know if the website has one.
(I have a big list of websites so I probably need to scrape them)
any suggestions on how I could do this without using external websites (like rescan.io/builtwith/etc) would be greatly appreciated!
thank you!
You can use a package called Puppeteer which is used to do web-scraping in node.js.
I don't know what platforms you are trying to look for, but I guess you could try something like giving the list of websites you want to check to a node.js process and ask Puppeteer to scrape them all. Then you look at the content you get back and for example look for Shopify's CDN in the tags or check the tags for keywords.
You will definitely need to check each different platform like Magento or Shopify for unique source code that clearly sets apart the framework you are looking at from other tools.

PWA InkCanvas save strokes as svg in javascript

I need to use InkCanvas in my web application using javascript (angular), is it possible to save InkCanvas as a SVG using javascript (or convert InCanvas to canvas)? i see this, but it seems it works for C#, i need a way to do it in javascript!
I think InkCanvas is only supported in Universal Windows Platform (UWP) for Windows10. This is confirmed in this SO post.
You can use Webassembly to run C# code in web browser using some JS helpers. Here is a post explaining the same.
You can try this with the c# code that you are interested in. Compatibility depended. These are relatively new features and only way to know is to try.

Best way to generate PDF from a template using nodejs

Now, I'm looking for the solution to generate pdf (invoice with barcode, etc..) from template(html, css) in nodejs environment. I found there are several ways to do that such as wkhtmltopdf, phantom.js & handlebars.js, html-pdf. What I'm concern is which is the best way to solve this problem.
Also, I have look at jsPDF, an client side generation, but it seem not suitable for production right now.
So, Anyone have used one of these library in production, please give me an advised.
Many thanks !
UPDATED:
Headless chromium is now ready for use.
Have some limitation (e.g: custom header, footer), but work great in almost cases.
https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
UPDATED: 4/2019
Now, Puppeteer is a major library for generating pdfs
https://github.com/GoogleChrome/puppeteer
If the invoice is on a static webpage, PhantomJS will allow you to generate a PDF . Here are a link to the screen-capture section of the docs. It shows you how simple it is do perform this :)

How do I access Google AdWords API with Node.js?

Is there a way to use node.js to access and manage a google adwords account?
I'm the author of an unofficial node.js client library for AdWords: https://www.npmjs.com/package/googleads-node-lib. It is getting closer to a feature complete client library every day. Pull requests welcome.
Yes, the library uses standard Javascript (it is built using Google's Closure library). What you might need to do is to write an HttpWebTransport adapter that works for Node.js. http://code.google.com/p/google-api-adwords-js/source/browse/#svn%2Ftrunk%2Fjs%2Fsystem%2Fsrc%2Fgoogle%2Fsystem%2Fnet has a few examples for specific technlogies like Google Gadgets, Chrome extensions, etc. , but there isn't one for Node.js. Also see http://code.google.com/p/google-api-adwords-js/source/browse/trunk/js/adwordsapi/src/config.js for details on how to configure the library to use a particular HttpWebTransport class.
Cheers,
Anash
I don't know much about node.js but if it's using standard JavaScript then you should be able to get somewhere with the new AdWords API JavaScript library: http://code.google.com/p/google-api-adwords-js/

Adding "posting" facility to a website

Hi
I am creating a website using HTML and CSS only and I want to add the following feature:
Any person visiting the site should be able to post a message and that message should appear below with his name and time of posting.
How do I go about creating it?
Please help.
Thanks In advance
You won't be able to do this using HTML and CSS only (at least not in any sane way).
You will need a database of some sort (e.g. MySql, Microsoft Access etc) and you will need some sort of server-side scripting language such as PHP, .NET, Ruby etc.
I suggest picking a language and then finding some tutorials. Most tutorials will take you through using a database.
This is completely impossible using HTML and CSS only. You will have to use a server-side scripting language.

Resources