This commit is contained in:
Developer01 2025-04-24 16:00:29 +02:00
commit 5714c54385
3 changed files with 29 additions and 36 deletions

View File

@ -77,6 +77,8 @@ Public Class frmFinalizePDF
Dim oNewPath = Path.Combine(desktopPath, $"E{txtEnvelope.Text}R{txtReceiver.Text}.burned.pdf")
File.WriteAllBytes(oNewPath, oNewBuffer)
Process.Start(oNewPath)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try

View File

@ -170,7 +170,7 @@ Namespace Jobs
Throw New ApplicationException("Envelope could not be finalized")
End If
Catch ex As Exception
Logger.Warn($"Unhandled exception while working envelope [{oId}] - [{ex.Message}]")
Logger.Warn(ex, $"Unhandled exception while working envelope [{oId}]")
End Try
@ -378,12 +378,10 @@ Namespace Jobs
Try
oInputDocumentBuffer = File.ReadAllBytes(oInputPath)
Catch ex As Exception
Logger.Error(ex)
Throw New BurnAnnotationException("Source document could not be read from disk!", ex)
End Try
End If
Return PDFBurner.BurnInstantJSONAnnotationsToPDF(oInputDocumentBuffer, oAnnotations)
End Function

View File

@ -31,8 +31,6 @@ Namespace Jobs.FinalizeDocument
Public Function BurnInstantJSONAnnotationsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()
Dim oResult As GdPictureStatus
Try
Using oSourceStream As New MemoryStream(pSourceBuffer)
' Open PDF
oResult = Manager.InitFromStream(oSourceStream)
@ -65,11 +63,6 @@ Namespace Jobs.FinalizeDocument
Return oNewStream.ToArray()
End Using
End Using
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
Private Function AddInstantJSONAnnotationToPDF(pInstantJSON As String) As Boolean