Skip to main content
Inspiring
July 11, 2016
Question

do not want PDF to open in browser

  • July 11, 2016
  • 2 replies
  • 492 views

would like to make link to PDF automatically open the 'save as' window and/or auto-download to user's computer.

form fields are not displaying in certain browsers.

How can I do this? Thank you!

This topic has been closed for replies.

2 replies

NKOWA555
Inspiring
July 12, 2016

You would have to do this with a server-side script; such as, PHP or ASP.net; but, it depends on your server's OS language

Example: ASP.net (C#):

try {

  Response.ContentType = "application/pdf";

  Response.AddHeader("content-disposition", "attachment; filename=" + FileName);

  Response.WriteFile(FilePath);

  Response.End();

} catch (Exception Ex) {

  Err.Clear();

}

r_tistAuthor
Inspiring
July 12, 2016

can PDF somehow have a popup overlay when opened in a browser that prompts user to save and print, especially if a real signature is needed?

try67
Community Expert
Community Expert
July 11, 2016

You can't. It's up to the user how the file is going to be opened/viewed on their machine. The best you can do it recommend to them to save it instead of opening it inside their browser window (or you could place the file in a zip archive, to force them to first save it locally and only then open it).

r_tistAuthor
Inspiring
July 11, 2016

OK, thanks for the options.