Conditionally apply PDF background for read-only envelopes

When preparing the PDF for the view, only apply the Background
method if the envelope is not read-only. This ensures that
read-only envelopes are displayed without additional background
elements.
This commit is contained in:
2026-01-20 10:54:31 +01:00
parent ad54ba9dc4
commit 5707213edd

View File

@@ -248,7 +248,9 @@ public class EnvelopeController : ViewControllerBase
{
if (er.Envelope!.Documents?.FirstOrDefault() is DocumentDto doc && doc.ByteData is not null)
{
using var pdf = Pdf.FromMemory(doc.ByteData).Background(doc.Elements!);
using var pdf = er.Envelope.ReadOnly
? Pdf.FromMemory(doc.ByteData)
: Pdf.FromMemory(doc.ByteData).Background(doc.Elements!);
doc.ByteData = pdf.ExportAsBytes();