(where @book.file_path returns the keyed URL to the PDF)
This displays the PDF in a popup window however, I just want to display
the PDF in a NEW browser window or, even better, in the native PDF
viewer.
I need to do this because on mobile devices (read iPad), this popup
doesn't work well. It draws the popup at the top of the page and the
user cannot see it unless he/she scrolls to the top. Even if they do
find it, the native behavior of the iPad PDF viewer--which is pretty
nice--is not there. i.e. I want it to behave just like it would if the
link were directly to the PDF.
I have tried window.open('mypdfpath') and many other combinations.
Is anyone doing this or have an idea how to approach it?
If the account / S3 URL should not be shown to the user, you could
stream the pdf content to them directly with your app as the proxy and
just set the appropriate http headers to give the user a suggested
name for the content - doing it this way will trigger the browser to
use whatever application is associated with PDF on their system to
display the content.
This sounds elegant but I haven't a clue how to start doing it.
In this scenario, the PDF still moves directly from S3 to the user's
browser, correct? (It's too slow to pull it locally and then send
it.)
If so, please send me to a reference for this or supply an example.