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(844)
Hands-On RESTful Web Services with ASP.NET Core 3 by Samuele Resca(703)
CSS 3 Visual Learning Guide: a comprehensive example set for getting up to speed fast by Ludo Mike(529)
PHP 7 Solutions by David Powers(434)
React js: The Ultimate Beginner's Guide to Learn React js Programming Step by Step - 2020 by Peterson Kathleen(427)
Getting Started with the Internet of Things by Pfister Cuno(383)
Beginning Git and GitHub by Mariot Tsitoara(379)
HTML 5 Visual Learning Guide: a comprehensive example set for getting up to speed fast by Ludo Mike(365)
Getting a Coding Job For Dummies by Nikhil Abraham(363)
Programming PHP by Kevin Tatroe Peter MacIntyre & Rasmus Lerdorf(322)
Magento 2 Development Cookbook by Bart Delvaux(321)
Programming PHP by Kevin Tatroe(303)
Creating Data-Driven Web Sites by Bob Terrell(302)
Full Stack Serverless by Nader Dabit(295)
Manifesto Comunista by Friedrich Engels(294)
Getting Started with OAuth 2.0 by Boyd Ryan(290)
Practical Oracle JET by Daniel Curtis(290)
gRPC by Kasun Indrasiri(278)
Building Web Applications with Erlang by Zachary Kessin(274)
