First version of service

This commit is contained in:
Jonathan Jenne
2023-12-08 15:23:50 +01:00
parent feb429f8f8
commit 49e6da3d79
5 changed files with 85 additions and 49 deletions

View File

@@ -27,8 +27,11 @@ Namespace Jobs
End Sub
Public Function BurnInstantJSONAnnotationsToPDF(pSourceFilePath As String, pInstantJSONList As List(Of String), pDestinationDirectoryPath As String) As Boolean
If Manager.InitFromFile(pSourceFilePath) <> GdPictureStatus.OK Then
Logger.Warn("Could not open file [{0}] for burning.", pSourceFilePath)
Dim oResult As GdPictureStatus
oResult = Manager.InitFromFile(pSourceFilePath)
If oResult <> GdPictureStatus.OK Then
Logger.Warn("Could not open file [{0}] for burning: [{1}]", pSourceFilePath, oResult.ToString)
Return False
End If
@@ -41,10 +44,21 @@ Namespace Jobs
Dim oFileInfo As New FileInfo(pSourceFilePath)
Dim oDestinationFilePath As String = Path.Combine(pDestinationDirectoryPath, oFileInfo.Name)
Try
Logger.Debug("Export filepath: [{0}]", oDestinationFilePath)
Try
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
If oResult <> GdPictureStatus.OK Then
Logger.Warn("Could not burn annotations to file file [{0}]: [{1}]", pSourceFilePath, oResult.ToString)
Return False
End If
oResult = Manager.SaveDocumentToPDF(oDestinationFilePath)
If oResult <> GdPictureStatus.OK Then
Logger.Warn("Could not save file [{0}] to path [{1}]: [{2}]", oFileInfo.Name, oDestinationFilePath, oResult.ToString)
Return False
End If
Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
Manager.SaveDocumentToPDF(oDestinationFilePath)
Manager.Close()
Return True