30 lines
826 B
C#
30 lines
826 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace OnDocAPI_NetFramework
|
|
{
|
|
public partial class PDFViewer : System.Web.UI.Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
string filePath = @"D:\apps\ondoc\admintemp\vp.pdf";
|
|
|
|
if (!System.IO.File.Exists(filePath))
|
|
{
|
|
Response.Write("PDF nicht gefunden.");
|
|
Response.End();
|
|
return;
|
|
}
|
|
|
|
Response.Clear();
|
|
Response.ContentType = "application/pdf";
|
|
Response.AddHeader("Content-Disposition", "inline; filename=sample.pdf");
|
|
Response.TransmitFile(filePath);
|
|
Response.End();
|
|
}
|
|
}
|
|
} |