feat(PDFBurner): add background rendering using PdfEditor before burning annotations

This commit is contained in:
2025-10-23 12:54:53 +02:00
parent b62cca5961
commit 8db5afae40
2 changed files with 6 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.CommonServices.Jobs.FinalizeDocument.FinalizeDocumentExceptions
Imports EnvelopeGenerator.Domain.Entities
Imports EnvelopeGenerator.PdfEditor
Imports GdPicture14
Imports Microsoft.EntityFrameworkCore
Imports Newtonsoft.Json
@@ -44,6 +45,11 @@ Namespace Jobs.FinalizeDocument
.Include(Function(sig) sig.Annotations) _
.ToList()
' Add background
Using doc As Pdf(Of MemoryStream, MemoryStream) = Pdf.FromMemory(pSourceBuffer)
pSourceBuffer = doc.Background(elements).ExportStream().ToArray()
End Using
Dim oResult As GdPictureStatus
Using oSourceStream As New MemoryStream(pSourceBuffer)
' Open PDF