开发者

ABCPdf - Opening the PDF file

开发者 https://www.devze.com 2023-02-13 05:47 出处:网络
Doc theDoc = new Doc(); theDoc.FontSize = 96; theDoc.AddText(\"Hello World\"); theDoc.Save(Server.MapPath(\"simple.pdf\"));
Doc theDoc = new Doc();
theDoc.FontSize = 96;
theDoc.AddText("Hello World");
theDoc.Save(Server.MapPath("simple.pdf"));
theDoc.Clear();

I understand that this creates the pdf and saves it. When I click on the link I have created for this I want the 开发者_如何学JAVApdf to just pop up in a pdf viewer, instead of me having to go to the actual location to see what it looks like after I have saved it. How do I get it to open?


You could provide a link to this file in your view which would allow the user to download the file once it is saved:

<a href="@Url.Content("~/simple.pdf")">simple.pdf</a>

And if you want it to open in a new window:

<a href="@Url.Content("~/simple.pdf")" target="_blank">simple.pdf</a>
0

精彩评论

暂无评论...
验证码 换一张
取 消