0

I am having a problem regarding downloading auto generated pdf file from controller.

I had created a pdf file and i wants it to download through browser.

My code is as follows-

 [pdf.IAMEViewPdf(this, null, "Voluntaryletter_pdf", Equiplist);]

here m generating a pdf, now I want to download it in the browser.

Thanks..

4
  • What is pdf ? What system/tool are you using to generate the PDF ? Commented Dec 22, 2012 at 8:35
  • We need more detail on that attribute. A snippet of the response output would be helpful as well. ADDITIONALLY, you need to define "problem" in much much much more detail than just "I have a problem". Commented Dec 22, 2012 at 9:36
  • Dear Hardrada, Here I am using itextsharp dll to generate PDF file. I succeed to generate PDF File but failed to download the same file through browser. Commented Dec 22, 2012 at 10:12
  • stackoverflow.com/questions/7307143/itextsharp-mvc-view-to-pdf Commented Dec 22, 2012 at 10:22

1 Answer 1

1

When you have dynamically generated your PDF file, you probably have it in a byte array. Then just write (in the MVC controller):

byte[] pdfFile = ...;
return File(buffer, "application/pdf", "Voluntaryletter.pdf");
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.