2023-09-11 - THUMBNAILS!!!!!
This commit is contained in:
@@ -10,10 +10,13 @@ Public Class EnvelopeEditorController
|
||||
|
||||
Public ReadOnly Envelope As Envelope = Nothing
|
||||
|
||||
Public ReadOnly Thumbnail As Thumbnail
|
||||
|
||||
Public Sub New(pState As State)
|
||||
MyBase.New(pState)
|
||||
|
||||
Envelope = CreateEnvelope()
|
||||
Thumbnail = New Thumbnail(pState.LogConfig)
|
||||
End Sub
|
||||
|
||||
Public Sub New(pState As State, pEnvelope As Envelope)
|
||||
@@ -22,6 +25,8 @@ Public Class EnvelopeEditorController
|
||||
Envelope = pEnvelope
|
||||
Envelope.Documents = DocumentModel.List(pEnvelope.Id)
|
||||
Envelope.Receivers = ReceiverModel.ListEnvelopeReceivers(pEnvelope.Id)
|
||||
|
||||
Thumbnail = New Thumbnail(pState.LogConfig)
|
||||
End Sub
|
||||
|
||||
#Region "Public"
|
||||
@@ -103,6 +108,10 @@ Public Class EnvelopeEditorController
|
||||
End Function
|
||||
|
||||
Public Function CleanupEnvelope() As Boolean
|
||||
If Envelope Is Nothing Then
|
||||
Return True
|
||||
End If
|
||||
|
||||
If Envelope.Status = Common.Constants.EnvelopeStatus.Created Then
|
||||
Return DeleteEnvelope(Envelope)
|
||||
Else
|
||||
@@ -113,14 +122,17 @@ Public Class EnvelopeEditorController
|
||||
Public Function CreateDocument(pDocumentFilePath As String) As EnvelopeDocument
|
||||
Try
|
||||
Dim oFileInfo = New FileInfo(pDocumentFilePath)
|
||||
Dim oTempDirectoryPath = Path.GetTempPath()
|
||||
Dim oTempFilePath = Path.Combine(oTempDirectoryPath, oFileInfo.Name)
|
||||
File.Copy(oFileInfo.FullName, oTempFilePath)
|
||||
Dim oTempFiles As TempFiles = New TempFiles(State.LogConfig)
|
||||
Dim oTempFilePath = Path.Combine(oTempFiles.TempPath, Guid.NewGuid().ToString + oFileInfo.Extension)
|
||||
File.Copy(oFileInfo.FullName, oTempFilePath, True)
|
||||
|
||||
Dim oDocument = New EnvelopeDocument() With {
|
||||
.FileInfo = New FileInfo(oTempFilePath)
|
||||
.FileInfo = New FileInfo(oTempFilePath),
|
||||
.FileNameOriginal = oFileInfo.Name,
|
||||
.Thumbnail = Thumbnail.GetThumbnailFromPDFFile(oTempFilePath)
|
||||
}
|
||||
|
||||
|
||||
Return oDocument
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user