+ Start a Discussion

How to close a PDF

From a Print button on my VFPage1, I create a Pagereference and pass a parameter to VFPage2 (which is rendered as a PDF).   The PDF can now be printed using the Print icon on the PDF toolbar.


The question is, how do I navigate away from the PDF?  If the back button is used, it will attempt to redisplay VFPage1 --- which will display incorrectly/incompletely because it needs input parameters.


How do I navigate to another page (i.e., without using a "Done" button)?  Is there a JS function that could help in this situation?





How about opening a pdf in a new window (target='_blank') so that the user just closes the window to "go back"? 

This seems to be what is done by many pages providing this kind of functionality.... 


Thanks! ....the _blank option worked --- using a commandLink. 


Is there any way to accomplish this using a commandButton?