I have an action who displays a PDF in a new browser tab.
public ActionResult Print()
{
var cd = new ContentDisposition
{
FileName ="something.pdf",
Inline = true
};
Response.AppendHeader("Content-Disposition", cd.ToString());
return File(reportResponse.Data.Document, MediaTypeNames.Application.Pdf);
}
The filename is working fine. When I download the file it has the name I want "something.pdf".
The problem is when google chrome opens the PDF in a new browser tab, it displays the controller action name (Print) as the title of the PDF. That's what I'm trying to change. I attached a picture for clarification.
View code: Url.Action("Print", "Controller", new { area = "Area" }), new { @target = "_blank" }