You need to sign in to do that
Don't have an account?
sksfdc221
Save visualforce as pdf or screenshot
I have a VF page (standard controller) with an iframe URL and I want the page to be downloaded as pdf or a screenshot on button click.
The issue is that, when i render the page as pdf or when i update my code to capture the screenshot, all i'm seeing is the plain/blank screen instead of page content.
So, as a workaround i am using print option so that i can save the record as pdf.
Below is my VF Page:
Can anyone please suggest the changes to the above code so that I can download the vf page as pdf or screenshot instead of printing and saving it as pdf
The issue is that, when i render the page as pdf or when i update my code to capture the screenshot, all i'm seeing is the plain/blank screen instead of page content.
So, as a workaround i am using print option so that i can save the record as pdf.
Below is my VF Page:
<apex:page standardController="Account" showheader="false" sidebar="false"> <apex:form > <apex:commandButton value="Print" onclick="window.print();"/> </apex:form> <apex:iframe src="https://app.powerbi.com/view?r=<custom-url>'" height="540" width="100%" frameborder="0"> </apex:iframe> </apex:page>
Can anyone please suggest the changes to the above code so that I can download the vf page as pdf or screenshot instead of printing and saving it as pdf
You can find the solution in the link given below:
https://salesforce.stackexchange.com/questions/100826/can-i-take-a-screen-shot-of-vf-page-and-store-into-document-or-attachment
Thanks,
Abhishek Bansal.
Thanks for your reply. I have already tried the solution mentioned in the given link and i am getting plain screen as output. I could only see the button which i have clicked in the screenshot instead of page content.
If you just want the screenshot, then you can use the getContent method of the PageReference and stored the return values as a Blob for the attachment. In this way you will get the exact data of the VF page in file or attachment.
Let me know if you need more help on this. For any immediate assisstance you can also reach out to me dircetly:
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790
Thanks,
Abhishek Bansal.