asp.net mvc 4 - PDF generation in mvc4 with itextsharp -


I am working on PDF generation, this is it It is also working fine on the local environment after publishing. We have our own server on other sites

but the same code does not work on the server, instead the PDF is generated, instead it returns an error: 'No page in the document is.' Initially I thought there is no data in this document, but it works without documentation or without data locally.

The code was applied to a web request to me, is there a problem?

  Try {var myHttpWebRequest = (HttpWebRequest) WebRequest.Create (strPdfData + "? ObjpatId =" + patID); Var response = myHttpWebRequest.GetResponse (); MyHttpWebRequest.Timeout = 900000; Var Stream = Response GETResponsestream (); Streamer sr = new streamrider (stream); Content = sr.ReadToEnd ();    

Make a method in the controller:

  [HttpPAGT] Public JasonResult GetFile () {var json = New webclient (). Download file (string address, string filename); // This code is just for converting the file into JSN which you can keep it in the file format and send it to the dynamic result = Newtonsoft.Json.JsonConvert.DeserializeObject (json); Var oc = Newtonsoft.Json.JsonConvert.DeserializeObject & lt; Countdata [] & gt; (Convert toString (Results countdata)); Return Jason (O.C., Jason Y. Best Behavior AloGuget); }   

Just call this function in the view:

  @ Url.Action ('genPDF', 'GetFile');    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -