Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

do not want PDF to open in browser

Enthusiast ,
Jul 11, 2016 Jul 11, 2016

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!

TOPICS
Acrobat SDK and JavaScript
420
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 11, 2016 Jul 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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 11, 2016 Jul 11, 2016

OK, thanks for the options.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 11, 2016 Jul 11, 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();

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 12, 2016 Jul 12, 2016
LATEST

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines