开发者

C# - Stream a PDF using Response.TransmitFile() or Response.WriteFile() And then select a page

开发者 https://www.devze.com 2022-12-13 15:51 出处:网络
I want to stream a pdf开发者_JS百科 from a directory on the server using an ASP.NET page. This works fine. The catch is that I want to pass Adobe Open Parameters to land on a specific page.

I want to stream a pdf开发者_JS百科 from a directory on the server using an ASP.NET page. This works fine. The catch is that I want to pass Adobe Open Parameters to land on a specific page.

Adobe has parameters for this: http://url/filename.pdf#page=XX

But, I can't find out how to stream the file rather than call it through a URL and get the #page= param to work.

Anyone ever done this?


For anyone having the same problem, I was able to solve this issue. If you change the content disposition in the Response.AddHeader from attachment to inline, then setup your url as:

http://url/Downloader.aspx?fileid=XX#page=YY

This will work. Your aspx page will render the pdf in the browser and the page parameter will navigate to the appropriate page. Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号