1
Setting
I have a list of files dynamically generated, and would like to have 3 options:
- Open up: display in browser (if it is PDF, JPG, etc);
- Download: download directly;
- Print out: send straight to standard printer.
What I got
Visualise with target="_blank
on the tag <a>
:
<td><a href="files/100-1533649017.pdf" target="_blank">MeuArquivo.pdf</a></td>
Download with download
on the tag <a>
:
<td><a href="files/100-1533649017.pdf" download>MeuArquivo.pdf</a></td>
Doubts
- Right away, I couldn’t find send direct to printer, there is native HTML form for this?
- If there is no native HTML form, which alternatives?
- There is a another way, the one I used to visualise?
- There is a another way, the one I used to download?
For print cases take a look at this link: Link
– ayelsew
@Wesleyaraujo I appreciate the help, but wanted to direct in HTML, and also not only PDF, I have XML, JPG, RAR, etc
– rbz
I don’t know if it’s possible with pure HTML. I think you at least have to put an attribute like "onclick(//JS code)" to get what you want
– ayelsew