Revert "Enhance PDF viewing experience with new document viewer"
This reverts commit 1cc617de42.
This commit is contained in:
@@ -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)}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user