2

I have my VF page render as pdf but I want to view the PDF before saving the pdf as attachment, any ideas?

2
  • What is the actual process that you are trying to use here with the custom object? Commented Jun 16, 2017 at 11:43
  • 1
    after filling a form ( to create an invoice) i have a custom button in the Invoice Object that generate a pdf , i want to save that pdf as attachement with invoice custom object , but before saving it i want to give the user a preview for that pdf and the choice to save it or not , ( like the principle of quotes ) ( so the problem is how to use the pdf viewer of salesforce ) Commented Jun 16, 2017 at 11:47

1 Answer 1

3

you can open the page in iframe and in parent page give option to save this page. If user like or want to save they just need to click on Save button. In save button regenerate the PDF in apex and save that.

4
  • 1
    in this case i'll not be able to see the pdf before saving it , because the VF page will not be rendred ? Commented Jun 16, 2017 at 11:43
  • @collin it will render. Just pass your page URL in iframe src attribute. Commented Jun 16, 2017 at 12:21
  • Thank you so much Sharma that worked for me , but it caused another problem , the pdf in the viewer don't display data correctly , but data in the downloaded file is correct, do you know where is the problem ? (the problem is in a pageBlockTable ) Commented Jun 16, 2017 at 13:15
  • @collin thats depends on calculation. You can post a separate question with some code. if this solve your problem you can accept this answer. Commented Jun 16, 2017 at 13:16

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.