title: Solution could not found FileStreamResult mvc5
body: <p>I'm working on a mvc5 project and at some point I will need to be able to print documents using the application.The problem is I get this error.</p>
  
  <blockquote>
    <p>Error The type or namespace name 'FileStreamResult' could not be found
    (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>My solution references on the business logic look like this:</p>
  
  <pre><code>using System;    
  using System.Collections.Generic;    
  using System.Data;    
  using System.Data.Entity;    
  using System.Linq;    
  using System.Web;    
  using System.Web.Mvc;    
  using Conference.Models;    
  using System.IO;    
  using iTextSharp.text;    
  using iTextSharp.text.pdf;    
  using System.Net.Mail;    
  using System.Text;    
  using System.Web.Helpers;
  </code></pre>
  
  <p>My method on the business logic like this:</p>
  
  <pre><code>  public FileStreamResult PrintPdf(int id)
          {
  
  
              // Set up the document and the MS to write it to and create the PDF writer instance
              MemoryStream ms = new MemoryStream();
              Document document = new Document(PageSize.A4, 0, 0, 0, 0);
              PdfWriter writer = PdfWriter.GetInstance(document, ms);
              //var obj = new simphiwe();
              var obj = new DataContext();
  
              // Open the PDF document
              document.Open();
  
              // Set up fonts used in the document
              Font font_heading_3 = FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12, Font.BOLD, BaseColor.RED);
              Font font_body = FontFactory.GetFont(FontFactory.TIMES_ROMAN, 9, BaseColor.BLUE);
  
              // Create the heading paragraph with the headig font
              Paragraph paragraph;
              paragraph = new Paragraph("Surgery", font_heading_3);
              Paragraph paraslip;
              paraslip = new Paragraph("**********************Document Records***********************");
  
              // Add image to pdf    
              // Create the heading paragraph with the headig font
              var info = from x in obj.Print
                         where x.Doc_Id == (id)
                         select x;
  
              foreach (var q in info)
              {
                  //paragraph;
                  // Add a horizontal line below the headig text and add it to the paragraph
                  iTextSharp.text.pdf.draw.VerticalPositionMark seperator = new iTextSharp.text.pdf.draw.LineSeparator();
                  seperator.Offset = -6f;
  
                  PdfPTable table1 = new PdfPTable(1);
                  PdfPTable table = new PdfPTable(1);
                  PdfPTable table3 = new PdfPTable(1);
                  PdfPTable table7 = new PdfPTable(1);
                  table.WidthPercentage = 80;
                  table3.SetWidths(new float[] { 100 });
                  table3.WidthPercentage = 80;
                  table7.SetWidths(new float[] { 100 });
                  table7.WidthPercentage = 80;
                  PdfPCell cell = new PdfPCell(new Phrase(""));
                  cell.Colspan = 3;
                  table1.AddCell(cell);
                  table7.AddCell("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" + "Surgery" + "\n\n" +
                    "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ "**********************Document Record***********************");
                  table.AddCell("Document Number    : " + q.Doc_Id);
                  table.AddCell("Patient Name         : " + q.Name);
                  table.AddCell("Document Comment: " + q.Content);
  
                  var d = new PrintRepository();
                  PrintData diet = d.GetById(q.Doc_Id);
                  table.AddCell("Doc_ID  :" + diet.Doc_Id);
  
                  table.AddCell("Date Issued : " + DateTime.Today.Day + "/" + DateTime.Today.Month + "/" + DateTime.Today.Year);
                  table.AddCell(cell);
                  document.Add(table3);
                  document.Add(table7);
                  document.Add(table1);
                  document.Add(table);
                  document.Close();
              }
              byte[] file = ms.ToArray();
              MemoryStream output = new MemoryStream();
              output.Write(file, 0, file.Length);
              output.Position = 0;
              FileStreamResult f = new FileStreamResult(output, "application/pdf");
              return f; //File(output, "application/pdf"); //new FileStreamResult(output, "application/pdf");
          }
      }
  </code></pre>