You need to sign in to do that
Don't have an account?
kisore poc
display attachment
hi ,
how to display images and pdf in a lightning component from attachemnts,. where img src tag dosent allow pdf it supports only images
how to display images and pdf in a lightning component from attachemnts,. where img src tag dosent allow pdf it supports only images
I trust you are doing very well.
You cannot show a pdf through HTML IMG tag. Instead, you should use either a javascript pdf viewer like the PDF.JS, or maybe you can render the pdf as its own page inside an iframe.
Please refer to the below link which might help you further with the above issue.
https://salesforce.stackexchange.com/questions/189451/lightning-component-pdf-viewer-iframe
https://salesforce.stackexchange.com/questions/188857/show-an-attachment-image-inside-a-lightning-component
https://github.com/kumarrk21/PDFViewer
https://medium.com/my-journey-with-salesforce1-platform/pdf-viewer-lightning-component-f96e6a5704ab
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks and Regards,
Khan Anas