I have my VF page render as pdf but I want to view the PDF before saving the pdf as attachment, any ideas?
- What is the actual process that you are trying to use here with the custom object?Dave Humm– Dave Humm2017-06-16 11:43:30 +00:00Commented Jun 16, 2017 at 11:43
- 1after 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 )collin– collin2017-06-16 11:47:54 +00:00Commented Jun 16, 2017 at 11:47
Add a comment |
1 Answer
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.
- 1in this case i'll not be able to see the pdf before saving it , because the VF page will not be rendred ?collin– collin2017-06-16 11:43:12 +00:00Commented Jun 16, 2017 at 11:43
- @collin it will render. Just pass your page URL in iframe src attribute.Tushar Sharma– Tushar Sharma2017-06-16 12:21:15 +00:00Commented 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 )collin– collin2017-06-16 13:15:14 +00:00Commented 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.Tushar Sharma– Tushar Sharma2017-06-16 13:16:40 +00:00Commented Jun 16, 2017 at 13:16