how to use jquery mobile asp.net mvc 4 to download and display pdf memory stream data -
i have desktop/mobile web app needs display pdf stream on target device. have working on desktop using jquery dialog. mobile tho...my html view page has next link:
<a href="@url.action("pdfview", new { id = @paystub.paystub_id})">view pdf</a>
and correctly takes me controller action:
public actionresult pdfview(string id = "") { paystubdataentity ps = paystubaccess.getpaystubbyid(new guid(id), new guid(session["session_application_userid"].tostring())); webhelper.setheadersfordownload(system.web.httpcontext.current.response, "application/pdf", "paystub.pdf", false); memorystream pdfmemorystream = sendpaystubtobrowseraspdf(ps); //webhelper.sendfile(system.web.httpcontext.current.response, "application/pdf", "paystub.pdf", false, pdfmemorystream); homecoming file(pdfmemorystream, "application/pdf"); }
but nil ever shows on iphone emulator (electric plum). no error messages. not sure output s/b going or how view it? ideas appreciated.
we have same issue android phones , there can 2 issues going on. if website uses ssl , phone on not take valid ssl, downloading pdf in manager, never completes download. sec issue file sending phone needs named in order download phone.
ex: homecoming file(pdfmemorystream, "application/pdf", filedownloadname:"paystub.pdf");
i suggest using google chrome phone emulation. when alter settings, behave phone , can debug easily. example, when set google chrome mobile phone user agent android 4.0.2, download pdf, instead of displaying within web browser. when that, know working locally. has iphone emulation.
asp.net-mvc jquery-mobile pdf-generation
No comments:
Post a Comment