Wednesday, October 9, 2019

PDF Reader as a Salesforce Lightning Web Component


This is a Lightning web component based on PDF.js library to render a PDF document (an unencoded string representation of the PDF blob) inside an iframe.

Check the code below for this component:
https://github.com/iamsonal/lwc-pdfReader



Share This:    Facebook Twitter

6 comments:

  1. Are you hard coding a pdf file uploaded on Salesforce and then displaying it inside the Iframe?

    If so, then what's the point?

    If not, then can you please expand on this functionality?

    Thanks

    ReplyDelete
    Replies
    1. There is a difference between PDF reader and PDF creator.

      Delete
  2. Hi Sonal,

    Thank you very much for this post, really helped a lot.

    ReplyDelete
  3. Hi Sonal,
    I have tried to implement this in a record page, content is displaying, but i couldn't adjust the height and width of the pdf viewer.
    How can we adjust the size of the component to fix on the right side of detail page

    ReplyDelete
  4. Hey, i am unable to use this same code with the latest PDF.js release. is this not supported with newer versions ?

    ReplyDelete
  5. hi, is this working also in community portal?

    ReplyDelete

Total Pageviews

My Social Profiles

View Sonal's profile on LinkedIn

Tags

__proto__ $Browser Access Grants Accessor properties Admin Ajax AllowsCallouts Apex Apex Map Apex Sharing AssignmentRuleHeader AsyncApexJob Asynchronous Auth Provider AWS Callbacks Connected app constructor Cookie CPU Time CSP Trusted Sites CSS Custom settings CustomLabels Data properties Database.Batchable Database.BatchableContext Database.query Describe Result Destructuring Dynamic Apex Dynamic SOQL Einstein Analytics enqueueJob Enterprise Territory Management Enumeration escapeSingleQuotes featured Flows geolocation getGlobalDescribe getOrgDefaults() getPicklistValues getRecordTypeId() getRecordTypeInfosByName() getURLParameters Google Maps Governor Limits hasOwnProperty() Heap Heap Size IIFE Immediately Invoked Function Expression Interview questions isCustom() Javascript Javascript Array jsForce Lightning Lightning Components Lightning Events lightning-record-edit-form lightning:combobox lightning:icon lightning:input lightning:select LockerService Lookup LWC Manual Sharing Map Modal Module Pattern Named Credentials NodeJS OAuth Object.freeze() Object.keys() Object.preventExtensions() Object.seal() Organization Wide Defaults Override PDF Reader Performance performance.now() Permission Sets Picklist Platform events Popup Postman Primitive Types Profiles Promise propertyIsEnumerable() prototype Query Selectivity Queueable Record types Reference Types Regex Regular Expressions Relationships Rest API Rest Operator Revealing Module Pattern Role Hierarchy Salesforce Salesforce Security Schema.DescribeFieldResult Schema.DescribeSObjectResult Schema.PicklistEntry Schema.SObjectField Schema.SObjectType Security Service Components Shadow DOM Sharing Sharing Rules Singleton Slots SOAP API SOAP Web Services SOQL SOQL injection Spread Operator Star Rating stripInaccessible svg svgIcon Synchronous this Token Triggers uiObjectInfoApi Upload Files VSCode Web Services XHR
Scroll To Top