Posts

Showing posts from January, 2020

How To Create/ Generate QRcode In SPFx Web Part

Image
A QR Code is a 2-dimensional bar code, which is generally used to encode a URL so that the user can scan the code using his/her smartphone to visit the concerned site. The camera/s of the latest smartphones can scan the QR code without having to install a separate app. Paytm is an example of how people started using QRCode widely nowadays. Installation Inside your SPFx project folder, run the below command from the terminal or node command prompt npm install --save qrcode or, install it globally to use the QR Code from the command line to save QR code images or generate ones you can view in your terminal. npm install -g qrcode Usage In your SPFx web part code, in the component file(.tsx/.ts), add the QR Code reference as below. var  QRCode = require( 'qrcode' );   In the render() method, add the image tag to render the QR Code image. <img id= "myQRcode"  height= "100%"  width= "100%"  />   In...