Electron: From Beginner to Pro by Chris Griffith & Leif Wells
Author:Chris Griffith & Leif Wells
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA
Published: 2017-11-24T16:00:00+00:00
This code waits half a second (that is what the 500 argument represents in milliseconds for setTimeout()), and then calls the same function as before to capture the window image. Give it a try to see your results (Figure 8-13).
Figure 8-13.Captured image of the window without the button down state
Alright! That is more like it! Great job!
The printToPDF Method
Like the capturePage method, the WebContents’ printToPDF method can be equally helpful. It is basically the same setup as the capturePage exercise. Let’s get started.
Open your index.html file and add the following code in bold to add a second button:
<body>
<h1>Hello World!</h1>
<!-- All of the Node.js APIs are available in this renderer process. -->
We are using Node.js <script>document.write(process.versions.node)</script>,
Chromium <script>document.write(process.versions.chrome)</script>,
and Electron <script>document.write(process.versions.electron)</script>.
<div>
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Fifty Quick Ideas to Improve Your Tests by Gojko Adzic David Evans and Tom Roden(852)
Hands-On RESTful Web Services with ASP.NET Core 3 by Samuele Resca(712)
CSS 3 Visual Learning Guide: a comprehensive example set for getting up to speed fast by Ludo Mike(539)
React js: The Ultimate Beginner's Guide to Learn React js Programming Step by Step - 2020 by Peterson Kathleen(446)
PHP 7 Solutions by David Powers(444)
Getting Started with the Internet of Things by Pfister Cuno(391)
Beginning Git and GitHub by Mariot Tsitoara(385)
HTML 5 Visual Learning Guide: a comprehensive example set for getting up to speed fast by Ludo Mike(374)
Getting a Coding Job For Dummies by Nikhil Abraham(368)
Magento 2 Development Cookbook by Bart Delvaux(330)
Programming PHP by Kevin Tatroe Peter MacIntyre & Rasmus Lerdorf(325)
Creating Data-Driven Web Sites by Bob Terrell(316)
Programming PHP by Kevin Tatroe(311)
Manifesto Comunista by Friedrich Engels(301)
Practical Oracle JET by Daniel Curtis(300)
Full Stack Serverless by Nader Dabit(300)
Getting Started with OAuth 2.0 by Boyd Ryan(294)
gRPC by Kasun Indrasiri(290)
Building Web Applications with Erlang by Zachary Kessin(282)
