diff --git a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb index 6a3d1aca..ccda7b83 100644 --- a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb +++ b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb @@ -44,12 +44,16 @@ Namespace Jobs.FinalizeDocument .Include(Function(sig) sig.Annotations) _ .ToList() + Return If(elements.Any(), + BurnElementAnnotsToPDF(pSourceBuffer, elements), + BurnInstantJSONAnnotsToPDF(pSourceBuffer, pInstantJSONList)) + End Function + + Public Function BurnElementAnnotsToPDF(pSourceBuffer As Byte(), elements As List(Of Signature)) As Byte() ' Add background Using doc As Pdf(Of MemoryStream, MemoryStream) = Pdf.FromMemory(pSourceBuffer) - pSourceBuffer = doc.Background(elements).ExportStream().ToArray() + Return doc.Background(elements).ExportStream().ToArray() End Using - - Return BurnInstantJSONAnnotsToPDF(pSourceBuffer, pInstantJSONList) End Function Public Function BurnInstantJSONAnnotsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()