Open a pdf in a iframe with close button on the page
Open a pdf in a iframe with close button on the page

in DataTables 2
Good day,
I am using iframe with datatables to prevent the full path of programmes and especially pdf documents from being displayed.
I would like to be able to open a pdf on a page where I can also insert a close button.
Any advice is appreciated...
Giuseppe
Answers
Hi Giuseppe,
It should be perfectly possible, but you'd to modify the library code a little bit. Here specifically - instead of using
.open()
or.download()
get the Blob and draw that into an iframe on your new page with the close button.Allan
Thanks,
if I have understood correctly this refers to the opening of a pdf in an iframe when I click on a button.
I am referring to opening files inserted in a table via file upload.
Is this the same thing?
Oh I see - I thought you were referring to the PDF export button, sorry.
There are a few ways to do what you want, but none of them specific to DataTables:
open
a new tab and then create the document with the iframe and a suitablesrc
address for it.src
parameter as part of the request and have the HTML for it built directly (which would save having one page per link!).These are how you would do it with or without DataTables.
Allan