Files
OnDoc/API_NetFramework/PDFViewer.aspx.cs
Stefan Hutter e82057b6e4 update 20260326
2026-03-26 18:26:34 +01:00

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();
}
}
}