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

This commit is contained in:
tekh 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

View File

@ -2,11 +2,9 @@
using iText.Kernel.Pdf.Canvas;
using EnvelopeGenerator.Domain.Interfaces;
using iText.Kernel.Colors;
using iText.Kernel.Geom;
#if NETFRAMEWORK
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
#endif