CBIT Managed Services and Solutions for small businesses HOME SERVICE SOLUTIONS PRIVACY POLICY CONTACT CBIT Data,Technology Display PDF Files with Lightning Web Components Display PDF Files with Lightning Web Components September 22, 2020 admin 0 Comments Did you ever wanted to see an uploaded PDF file on Salesforce on a lightning page? The recent release of the Salesforce Lightning Web Components enables you to upgrade your Salesforce fix so that it supports the latest Web Viewer. It ensures that you enjoy better rendering accuracy and get access to the newer and better web features, like the salesforce pdf generation app. If you want to plugin a professional MS Office and PDF Viewer into your Salesforce, then you should keep on reading. This article will reveal the deeper secrets of Salesforce and will show you the tricks of adding PDF Tron WebVIewer to Salesforce as the Salesforce Lightning Web Component. Getting Started To start the journey, you have to clone the sample Lightning web Component project from the Github. You should also download the web viewer. Setting Up Salesforce DX In the next step, you have to set up the Salesforce DX for your organization. You can do that but signing it up for a Dev Hub trial or through your existing Salesforce Dev Hub. You should check and follow the instructions available in the Salesforce DX set up guide to get started. Optimize the Web Viewer Source Code Now you have to optimize the salesforce pdf generation app web viewer code for Salesforce. Extract the webviewr.zip from your earlier downloads to make this work. Once done, run the NPM script. After you get the prompts, always answer with ‘Y’ when you are asked whether you need to deploy it to Salesforce. Once you do that, the script will get optimized, and it will zip the source code that you will need in the future. The zip file that you will get from this should be small enough to be uploaded to your Salesforce. Installing the Sample LWC App The following steps will help you to configure and clone the samples of web viewer-Salesforce project. First of all, go to the Github repo and clone the web viewer-Salesforce. Copy all the zip files which generate by running the npm optimizing scripts from the output folder. Add the license key of Webviewer in the web viewer constructor. Otherwise, authenticate your hug org and offer it with an alias from your cmd or terminal. Put in your Dev Hub Org credential into the browser that pops. Type the word dev hub in the search bar and toggle it enabled. Using config/project-scratch-def.json, just create a scratch org and set the user name. You can also assign an alias to it by replacing the my-scratch-org. Just need to push the app to the scratch org and open it. A browser will pop open. You need to select the app launcher icon and then click on the PDF Butler App on Salesforce. Key Factors You Should Remember You should use the setup to change the default attitude of PDF file URLs in salesforce. If you don’t do that, when a user goes to the file via an URL, the default action will be to download the file. You can further customize the file according to your requirements. Now that you know the steps of displaying the salesforce pdf generation app with Lightning web component, it’ time for you to experiment yourself. Start coding and have fun. Previous How to sync Gmail or Google Contacts to an Iphone? Next Build Customer Relationships with Direct Mail Automation RECENT COMMENTS ARCHIVES May 2021 April 2021 September 2020 May 2020 February 2020 August 2019 May 2019 April 2019 March 2019 February 2019 CATEGORIES Address Verification Cell phone repair Data Direct Mail Information Technology SEO and Digital Marketing Technology META Log in Entries RSS Comments RSS WordPress.org About Us The information technology market is constantly changing, and CBiT staff has developed the Training Centre Curriculum to meet the growing needs of the informed computer user and professional. CBiT offers solutions that bring visible, immediate results, providing participants with the expertise and skills needed to make them competent computer users and valuable assets to their companies. Video Video Player 00:00 00:00 Recent Post How to Prevent Bad Data From Affecting Your Business? Build Customer Relationships with Direct Mail Automation Display PDF Files with Lightning Web Components How to sync Gmail or Google Contacts to an Iphone? Why would you need a cell phone repair store in Toronto? Search copyright 2019 cbit.ca ThemesGlance