How can we download or view the PDF file using Lightning Component from documents in salesforce1 app, is it possible to do or not, if yes please suggest how can i achieve this.
How can we download or view the PDF file using Lightning Component from documents in salesforce1 app, is it possible to do or not, if yes please suggest how can i achieve this.
Best Answer
If you use Files or content related object there is a simple event with new lightning namespace which can be used
Here is a sample quick POC
Note that the default here is the Id of the content document .
The controller code for same is below
Here is how the component looks in the UI
Once you click this the below should appear
For SF1 there is a repo which covers the same using a third party JS library
https://github.com/kumarrk21/PDFViewer/tree/master/src/aura