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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user