Google chrome pdf download c# app






















Connect and share knowledge within a single location that is structured and easy to search. My app dynamically generates a PDF report when the user browses to a particular aspx page. For the most part, things work fine on various browsers. However, on Chrome, when Chrome's PDF viewer is being used, the following can happen : - the user presses the floating diskette icon on the bottom right hand side of the viewer to save the PDF document.

The file is saved with the aspx page's name. But is there a way to get chrome to default the name of the file to save to have a ". PDF" extension? In Chrome it won't display it in its PDF viewer - just gives the user the chance after downloading to open the file using whatever program they have associated with the ". You should try using content-disposition header while streaming the PDF file to the browser.

For example,. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 10 years, 2 months ago. Active 8 years, 11 months ago. At no point does it ask whether you want to download it instead.

I simply copy and paste the link in Firefox and download the file. Bu not everyone will want to install another browser just to download PDF files. Doing so will make Chrome download PDF files instead of opening them. This site uses Akismet to reduce spam. Learn how your comment data is processed. Thus, the solution here is to add response. ToString ; before writing the contents.

Try with "Content-disposition: attachment" header. This will get the pdf forced downloaded. What i want it here is to get it forced Open in the browser, so I used inline.

It can open the pdf in IE but got stuck in chrome while opening — Martitanic. Thanks mkl's suggestions. I added the content length in the header and the pdf can be successfully opened in Chrome! Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Introducing Content Health, a new way to keep the knowledge base up-to-date. Podcast what if you could invest in your favorite developer? Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer.

Related Hot Network Questions.



0コメント

  • 1000 / 1000