I have a pdf file embedded on a web page .net core, razor page in C#. I want to put a print button the web page so that the end user can print the pdf file. How can I achieve this? Below is the code for embedding the pdf file on web browser:
using (MemoryStream stream = new MemoryStream())
{
string embed = "<object data=\"{0}\" type=\"application/pdf\" width=\"1000px\" height=\"1000px\">";
embed += "If you are unable to view file, you can download from <a href = \"{0}\">here</a>";
embed += " or download <a target = \"_blank\" href = \"http://get.adobe.com/reader/\">Adobe PDF Reader</a> to view the file.";
embed += "</object>";
TempData["Embed"] = string.Format(embed, "/FilledPDFFiles/Confidentiality Statement" + ".pdf");
return View();
}
razor view is like this:
<div style="margin-top:30px">
@Html.Raw(TempData["Embed"])
</div>
any help will be appreciated.