Revert "Enhance PDF viewing experience with new document viewer"

This reverts commit 1cc617de42.
This commit is contained in:
OlgunR
2026-06-09 11:48:41 +02:00
parent 559829882a
commit 746465d8fe
4 changed files with 5 additions and 58 deletions

View File

@@ -18,6 +18,7 @@ public class ViewPdfModel : PageModel
public async Task<IActionResult> OnGetAsync(int id)
{
// Sicherheit: defensive checks, gleiche Logik wie CustomReportStorageWebExtension
var invoice = await _db.ZugferdInvoices
.AsNoTracking()
.FirstOrDefaultAsync(i => i.Id == id);
@@ -34,10 +35,6 @@ public class ViewPdfModel : PageModel
var bytes = await System.IO.File.ReadAllBytesAsync(invoice.ResultFilePath);
_logger.LogInformation("ViewPdf: Invoice {Id} ausgeliefert ({Size} Bytes).", id, bytes.Length);
// Wichtig: keine "attachment" Content-Disposition setzen
// wir setzen inline (oder lassen es weg) damit Browser im Viewer darstellt
Response.Headers["Content-Disposition"] = $"inline; filename=\"{Path.GetFileName(invoice.ResultFilePath)}\"";
return File(bytes, "application/pdf");
return File(bytes, "application/pdf", $"{Path.GetFileName(invoice.ResultFilePath)}");
}
}