You need to sign in to do that
Don't have an account?

Show pdf in popup with two buttons
Hello,
Here is my goal :
On opportunity page i want to have a button that open a popup with
- a pdf that i generate (renderas)
- two buttons (save & save as attachment) -save i natively supported with renderas-
Is there a way to easy open a popup with a visualpage inside ? i want to stay on the opportunity page.
Thanks
Here is my goal :
On opportunity page i want to have a button that open a popup with
- a pdf that i generate (renderas)
- two buttons (save & save as attachment) -save i natively supported with renderas-
Is there a way to easy open a popup with a visualpage inside ? i want to stay on the opportunity page.
Thanks
I used the below lightning component code to open a lightning component which has a visualforce page that is rendered as pdf and below this, you can have the button to download vfpage that is rendered as pdf.
The lightning component I used is below
The code for component with visualfforce page in it is:
Below is the output I got:
For the button to save the document you can use this link to refer this implementation:
>> https://www.vermanshul.com/2017/07/lightning-generate-pdf-from-lightning.html
I hope this helps and in case if this comes in handy can you please choose this as the best answer so that it can be useful for others in the future.
Regards,
Anutej
1> Create a visualforce page which is rendered as pdf.
2> create a lightning component lets call it lcvf and paste the above codes for 1,2 in apex class create and paste 3rd part of the code.
3> to show the vfpage in lightning component paste the below line in component code instead of <c:js/>
<iframe src="{! 'URL to the VFpage' }" width="100%" height="500px;" frameBorder="0"/>
Now place the lcvf lightning component on the detail page.
Let me know in case if there are any questions.
In case if the above solution came in handy can you please choose this as the best answer so that it can be used by others in the future.
Thanks,
Anutej