function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raj01Raj01 

How to open a PDF document in unauthenticated community Lightning page?

Hi,

I have a PDF file (static content) which i would like to open in a popup window when user clicks on a link in unauthenticated community portal lighting component. 

Thank you 



 
MagulanDuraipandianMagulanDuraipandian
You can use Public Link from the file and share the URL in the community.
https://www.infallibletechie.com/2020/03/creating-public-link-from-salesforce.html
AbhishekAbhishek (Salesforce Developers) 
Hi Raj,

There are two methods to show a PDF in Lightning Component.

First, you can create a Visualforce page and embed it in the Lightning component. See a detailed example,

http://www.vermanshul.com/2017/07/lightning-generate-pdf-from-lightning.html

Second is the usage of PDF.JS library to directly use the lightning component to display the PDF. See the details

https://medium.com/my-journey-with-salesforce1-platform/pdf-viewer-lightning-component-f96e6a5704ab

The entire source code can be found,

https://github.com/kumarrk21/PDFViewer

Let me know if this helps!