title: Display PDF(stored as a BLOB) as an image in MVC
body: <p>I have to display a PDF(stored as BLOB in SQL Server table) in a partial view. I am doing the same for a ".jpeg" image stored as BLOB in the table.The image is getting displayed,however,the PDF isnt.I have the following code in my controller:</p>
  
  <pre><code>[Authorize]
  public ActionResult Show3LeadImage(int id)
  {
      Byte[] imageData = null;
      using (var scope = new PatientPersistenceScope())
      {
           searchRequest leadRequest = new searchRequest();
           leadRequest.CaseNumber = id;
           var mrx12LeadBitmap = _mrxSearchService.Get12Lead(leadRequest);
           imageData = mrx12LeadBitmap.Data12Leads[0].mrx3Lead;
           scope.Done();
      }
     return File(imageData,"image/png");//I have tried "FileContentResult,but it didnt work
   }
  </code></pre>
  
  <p>The code in the partial view(.ascx) looks like this:</p>
  
  <pre><code>&lt;object data='&lt;%= Url.Action("Show3LeadImage", "CareRecord", new { id = Model.CareRecord.CaseNumber}) %&gt;' type="application/pdf" style="width: 721px; height: 800px;" &gt;&lt;/object&gt;
  </code></pre>
  
  <p>I do not have access to the physical file....the BLOB is all I have.</p>
  
  <p>Is it even possible to display a PDF as image in partial view? I came across lots of articles that explained how to make a PDF available for download in the partial view.But I do not want my file to be downloadable. Is this functionality achievable or am I trying to do something impossible?</p>