Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Presented By: Muskan Gupta
Export PDF with
Puppeteer
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are reque...
Our Agenda
1. Node.js
2. Node modules
3. NPM(Node Package Manager)
4. HandleBars
5. Introduction to Puppeteer
6. Demo
7. P...
Node.js
● Node.js is an open source server environment.
● Node.js runs on various platforms (Windows, Linux, Unix, Mac OS,...
Node Module
● Node module is a functionality organized in single or multiple JavaScript files which
can be reused througho...
NPM(Node Package Manager)
● NPM is a repository where we have a large
number of node modules available.
● It is also a com...
HandleBars
● HandleBars is a node module which is used to create html templates.
● It uses a template and a data object to...
Introduction to Puppeteer
According to the documentation :
Puppeteer is a Node library which provides a high-level API to ...
Usage of Puppeteer
● Generate screenshots and PDFs of pages.
● Crawl a SPA (Single-Page Application) and generate pre-rend...
Generate PDF with Puppeteer
Demo
Problems with Puppeteer
and their Solution
● Loading of an image
Rather than directly passing the data, create an html pag...
References
● puppeteer
● What is npm?.
● Node.js Modules.
● Node.js Introduction
● Introduction to HandleBars
Thank You !
Upcoming SlideShare
Loading in …5
×

Export pdf with puppeteer

In this session, I will discuss the use of puppeteer for implementing a simple feature of export to pdf. We will also discuss some of the problems that one can face, and how they can be resolved.

  • Be the first to comment

  • Be the first to like this

Export pdf with puppeteer

  1. 1. Presented By: Muskan Gupta Export PDF with Puppeteer
  2. 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes Punctuality Respect Knolx session timings, you are requested not to join sessions after a 5 minutes threshold post the session start time. Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Silent Mode Keep yourself muted until and unless you have any query.
  3. 3. Our Agenda 1. Node.js 2. Node modules 3. NPM(Node Package Manager) 4. HandleBars 5. Introduction to Puppeteer 6. Demo 7. Problems with Puppeteer and their Solution
  4. 4. Node.js ● Node.js is an open source server environment. ● Node.js runs on various platforms (Windows, Linux, Unix, Mac OS, etc.). ● Node.js uses JavaScript on the server. ● Node.js is asynchronous. ● Node.js is single-threaded and highly scalable.
  5. 5. Node Module ● Node module is a functionality organized in single or multiple JavaScript files which can be reused throughout the Node.js application. ● Each module in Node.js has its own context.
  6. 6. NPM(Node Package Manager) ● NPM is a repository where we have a large number of node modules available. ● It is also a command line utility, to install these node modules. ● For installing : npm install module_name
  7. 7. HandleBars ● HandleBars is a node module which is used to create html templates. ● It uses a template and a data object to generate HTML page. ● To install : npm install handlebars ● For example : Input Template HTML
  8. 8. Introduction to Puppeteer According to the documentation : Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.
  9. 9. Usage of Puppeteer ● Generate screenshots and PDFs of pages. ● Crawl a SPA (Single-Page Application) and generate pre-rendered content (i.e. "SSR" (Server-Side Rendering)). ● Automate form submission, UI testing, keyboard input, etc. ● Create an up-to-date, automated testing environment. Run your tests directly in the latest version of Chrome using the latest JavaScript and browser features. ● Test Chrome Extensions.
  10. 10. Generate PDF with Puppeteer
  11. 11. Demo
  12. 12. Problems with Puppeteer and their Solution ● Loading of an image Rather than directly passing the data, create an html page and goto that page to create PDF. ● Problem with chromium available in puppeteer on EC2 instances Install chromium on EC2 instance explicitly. Set chromium path to the chromium installed. And now instead of puppeteer use puppeteer-core.
  13. 13. References ● puppeteer ● What is npm?. ● Node.js Modules. ● Node.js Introduction ● Introduction to HandleBars
  14. 14. Thank You !

×