Compare commits
24 Commits
3c5f5cb5f5
...
feat/posit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
186f3c3319 | ||
|
|
276adda516 | ||
|
|
ac0ae10fab | ||
|
|
3713669ec5 | ||
|
|
7f0131fc2d | ||
|
|
d9deb589d1 | ||
|
|
c961e9fffd | ||
|
|
ae31b1da0f | ||
|
|
bf5faf53bd | ||
|
|
9a74b448f2 | ||
|
|
784a834214 | ||
|
|
7c57b7e332 | ||
|
|
4bf91df85f | ||
|
|
50796b22d9 | ||
|
|
2974ddb985 | ||
|
|
54f39103e1 | ||
|
|
8b505ae39a | ||
|
|
d75da655d2 | ||
|
|
e72ea534e5 | ||
|
|
e95d1d782e | ||
|
|
32be5077f9 | ||
|
|
d80fa0b023 | ||
|
|
ea6ee11a4e | ||
|
|
13a87f29d9 |
@@ -77,6 +77,8 @@ Public Class frmFinalizePDF
|
|||||||
Dim oNewPath = Path.Combine(desktopPath, $"E{txtEnvelope.Text}R{txtReceiver.Text}.burned.pdf")
|
Dim oNewPath = Path.Combine(desktopPath, $"E{txtEnvelope.Text}R{txtReceiver.Text}.burned.pdf")
|
||||||
|
|
||||||
File.WriteAllBytes(oNewPath, oNewBuffer)
|
File.WriteAllBytes(oNewPath, oNewBuffer)
|
||||||
|
|
||||||
|
Process.Start(oNewPath)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
MsgBox(ex.Message, MsgBoxStyle.Critical)
|
||||||
End Try
|
End Try
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ Namespace Jobs
|
|||||||
Throw New ApplicationException("Envelope could not be finalized")
|
Throw New ApplicationException("Envelope could not be finalized")
|
||||||
End If
|
End If
|
||||||
Catch ex As Exception
|
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
|
End Try
|
||||||
|
|
||||||
|
|
||||||
@@ -378,12 +378,10 @@ Namespace Jobs
|
|||||||
Try
|
Try
|
||||||
oInputDocumentBuffer = File.ReadAllBytes(oInputPath)
|
oInputDocumentBuffer = File.ReadAllBytes(oInputPath)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
Logger.Error(ex)
|
|
||||||
Throw New BurnAnnotationException("Source document could not be read from disk!", ex)
|
Throw New BurnAnnotationException("Source document could not be read from disk!", ex)
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Return PDFBurner.BurnInstantJSONAnnotationsToPDF(oInputDocumentBuffer, oAnnotations)
|
Return PDFBurner.BurnInstantJSONAnnotationsToPDF(oInputDocumentBuffer, oAnnotations)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|||||||
@@ -31,45 +31,38 @@ Namespace Jobs.FinalizeDocument
|
|||||||
|
|
||||||
Public Function BurnInstantJSONAnnotationsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()
|
Public Function BurnInstantJSONAnnotationsToPDF(pSourceBuffer As Byte(), pInstantJSONList As List(Of String)) As Byte()
|
||||||
Dim oResult As GdPictureStatus
|
Dim oResult As GdPictureStatus
|
||||||
|
Using oSourceStream As New MemoryStream(pSourceBuffer)
|
||||||
|
' Open PDF
|
||||||
|
oResult = Manager.InitFromStream(oSourceStream)
|
||||||
|
If oResult <> GdPictureStatus.OK Then
|
||||||
|
Throw New BurnAnnotationException($"Could not open document for burning: [{oResult}]")
|
||||||
|
End If
|
||||||
|
|
||||||
Try
|
' Add annotation to PDF
|
||||||
Using oSourceStream As New MemoryStream(pSourceBuffer)
|
For Each oJSON In pInstantJSONList
|
||||||
' Open PDF
|
If AddInstantJSONAnnotationToPDF(oJSON) = False Then
|
||||||
oResult = Manager.InitFromStream(oSourceStream)
|
Logger.Warn($"Error in AddInstantJSONAnnotationToPDF - oJson: ")
|
||||||
|
Logger.Warn(oJSON)
|
||||||
|
Throw New BurnAnnotationException($"Adding Annotation failed")
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
|
||||||
|
If oResult <> GdPictureStatus.OK Then
|
||||||
|
Throw New BurnAnnotationException($"Could not burn annotations to file: [{oResult}]")
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Save PDF
|
||||||
|
Using oNewStream As New MemoryStream()
|
||||||
|
oResult = Manager.SaveDocumentToPDF(oNewStream)
|
||||||
If oResult <> GdPictureStatus.OK Then
|
If oResult <> GdPictureStatus.OK Then
|
||||||
Throw New BurnAnnotationException($"Could not open document for burning: [{oResult}]")
|
Throw New BurnAnnotationException($"Could not save document to stream: [{oResult}]")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
' Add annotation to PDF
|
Manager.Close()
|
||||||
For Each oJSON In pInstantJSONList
|
|
||||||
If AddInstantJSONAnnotationToPDF(oJSON) = False Then
|
|
||||||
Logger.Warn($"Error in AddInstantJSONAnnotationToPDF - oJson: ")
|
|
||||||
Logger.Warn(oJSON)
|
|
||||||
Throw New BurnAnnotationException($"Adding Annotation failed")
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
oResult = Manager.BurnAnnotationsToPage(RemoveInitialAnnots:=True, VectorMode:=True)
|
|
||||||
If oResult <> GdPictureStatus.OK Then
|
|
||||||
Throw New BurnAnnotationException($"Could not burn annotations to file: [{oResult}]")
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Save PDF
|
Return oNewStream.ToArray()
|
||||||
Using oNewStream As New MemoryStream()
|
|
||||||
oResult = Manager.SaveDocumentToPDF(oNewStream)
|
|
||||||
If oResult <> GdPictureStatus.OK Then
|
|
||||||
Throw New BurnAnnotationException($"Could not save document to stream: [{oResult}]")
|
|
||||||
End If
|
|
||||||
|
|
||||||
Manager.Close()
|
|
||||||
|
|
||||||
Return oNewStream.ToArray()
|
|
||||||
End Using
|
|
||||||
End Using
|
End Using
|
||||||
Catch ex As Exception
|
End Using
|
||||||
Logger.Error(ex)
|
|
||||||
|
|
||||||
Return Nothing
|
|
||||||
End Try
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Function AddInstantJSONAnnotationToPDF(pInstantJSON As String) As Boolean
|
Private Function AddInstantJSONAnnotationToPDF(pInstantJSON As String) As Boolean
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ Public Class EnvelopeEditorController
|
|||||||
DocumentRotationChanged()
|
DocumentRotationChanged()
|
||||||
Logger.Info("PageRotation has been reseted to 0.")
|
Logger.Info("PageRotation has been reseted to 0.")
|
||||||
End If
|
End If
|
||||||
GdPicturePDF.FlattenFormFields()
|
oFixedPath = FlattenFormFields.FlattenFormFields(oFixedPath)
|
||||||
Dim oFileInfo = New FileInfo(oFixedPath)
|
Dim oFileInfo = New FileInfo(oFixedPath)
|
||||||
Dim oTempFiles As New TempFiles(State.LogConfig)
|
Dim oTempFiles As New TempFiles(State.LogConfig)
|
||||||
Dim oTempFilePath = Path.Combine(oTempFiles._TempPath, Guid.NewGuid().ToString + oFileInfo.Extension)
|
Dim oTempFilePath = Path.Combine(oTempFiles._TempPath, Guid.NewGuid().ToString + oFileInfo.Extension)
|
||||||
|
|||||||
@@ -369,6 +369,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Helper\Encryption.vb" />
|
<Compile Include="Helper\Encryption.vb" />
|
||||||
<Compile Include="Helper\FixPageRotation.vb" />
|
<Compile Include="Helper\FixPageRotation.vb" />
|
||||||
|
<Compile Include="Helper\FlattenFormFields.vb" />
|
||||||
<Compile Include="Helper\RefreshHelper.vb" />
|
<Compile Include="Helper\RefreshHelper.vb" />
|
||||||
<Compile Include="Helper\TempFiles.vb" />
|
<Compile Include="Helper\TempFiles.vb" />
|
||||||
<Compile Include="Helper\Thumbnail.vb" />
|
<Compile Include="Helper\Thumbnail.vb" />
|
||||||
|
|||||||
32
EnvelopeGenerator.Form/Helper/FlattenFormFields.vb
Normal file
32
EnvelopeGenerator.Form/Helper/FlattenFormFields.vb
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
Imports System.IO
|
||||||
|
Imports GdPicture14
|
||||||
|
|
||||||
|
Public Class FlattenFormFields
|
||||||
|
|
||||||
|
Public Shared Function FlattenFormFields(pFilePath As String) As String
|
||||||
|
|
||||||
|
Dim oFolder As String = Path.GetDirectoryName(pFilePath)
|
||||||
|
|
||||||
|
Dim gdpicturePdf As GdPicturePDF = New GdPicturePDF()
|
||||||
|
|
||||||
|
Dim status As GdPictureStatus = gdpicturePdf.LoadFromFile(pFilePath, True)
|
||||||
|
If status = GdPictureStatus.OK Then
|
||||||
|
|
||||||
|
Dim oFormFieldsCount = gdpicturePdf.GetFormFieldsCount()
|
||||||
|
If oFormFieldsCount > 0 Then
|
||||||
|
gdpicturePdf.FlattenFormFields()
|
||||||
|
|
||||||
|
Dim newFilesPath As String = Path.Combine(oFolder, "InputFieldsFlattend_" & Path.GetFileName(pFilePath))
|
||||||
|
If gdpicturePdf.SaveToFile(newFilesPath) = GdPictureStatus.OK Then
|
||||||
|
Return newFilesPath
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return pFilePath
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
End Class
|
||||||
@@ -24,4 +24,6 @@ Module ModuleSettings
|
|||||||
Public USER_GHOST_MODE_ACTIVE As Boolean = False
|
Public USER_GHOST_MODE_ACTIVE As Boolean = False
|
||||||
Public MyUserModel As UserModel
|
Public MyUserModel As UserModel
|
||||||
Public MyState As State
|
Public MyState As State
|
||||||
|
Public CurrentEnvelopID As Integer = 0
|
||||||
|
Public CurrentEnvelopetitle As String = ""
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
2
EnvelopeGenerator.Form/frmMain.Designer.vb
generated
2
EnvelopeGenerator.Form/frmMain.Designer.vb
generated
@@ -688,7 +688,7 @@ Partial Class frmMain
|
|||||||
'SplitContainerControl2.Panel2
|
'SplitContainerControl2.Panel2
|
||||||
'
|
'
|
||||||
resources.ApplyResources(Me.SplitContainerControl2.Panel2, "SplitContainerControl2.Panel2")
|
resources.ApplyResources(Me.SplitContainerControl2.Panel2, "SplitContainerControl2.Panel2")
|
||||||
Me.SplitContainerControl2.SplitterPosition = 584
|
Me.SplitContainerControl2.SplitterPosition = 819
|
||||||
'
|
'
|
||||||
'GridControlData
|
'GridControlData
|
||||||
'
|
'
|
||||||
|
|||||||
@@ -1139,7 +1139,7 @@
|
|||||||
<value>0, 0</value>
|
<value>0, 0</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GridControlData.Size" type="System.Drawing.Size, System.Drawing">
|
<data name="GridControlData.Size" type="System.Drawing.Size, System.Drawing">
|
||||||
<value>584, 390</value>
|
<value>819, 390</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="GridControlData.TabIndex" type="System.Int32, mscorlib">
|
<data name="GridControlData.TabIndex" type="System.Int32, mscorlib">
|
||||||
<value>1</value>
|
<value>1</value>
|
||||||
|
|||||||
@@ -183,7 +183,11 @@ Public Class frmMain
|
|||||||
Private Sub btnDeleteEnvelope_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDeleteEnvelope.ItemClick
|
Private Sub btnDeleteEnvelope_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnDeleteEnvelope.ItemClick
|
||||||
Try
|
Try
|
||||||
Dim oSelectedRows = ViewEnvelopes.GetSelectedRows()
|
Dim oSelectedRows = ViewEnvelopes.GetSelectedRows()
|
||||||
|
Dim oEnvelope As Envelope = DirectCast(ViewEnvelopes.GetRow(oSelectedRows.First), Envelope)
|
||||||
|
|
||||||
If oSelectedRows.Count > 0 Then
|
If oSelectedRows.Count > 0 Then
|
||||||
|
CurrentEnvelopID = oEnvelope.Id
|
||||||
|
CurrentEnvelopetitle = oEnvelope.Title
|
||||||
Dim ofrmAbort As New frmRueckruf
|
Dim ofrmAbort As New frmRueckruf
|
||||||
frmRueckruf.ShowDialog()
|
frmRueckruf.ShowDialog()
|
||||||
If frmRueckruf.Continue_Reject = True Then
|
If frmRueckruf.Continue_Reject = True Then
|
||||||
@@ -203,36 +207,44 @@ Public Class frmMain
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub XtraTabControl1_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControlMain.SelectedPageChanged
|
Private Sub XtraTabControl1_SelectedPageChanged(sender As Object, e As DevExpress.XtraTab.TabPageChangedEventArgs) Handles XtraTabControlMain.SelectedPageChanged
|
||||||
RibbonPageGroupFunctions.Enabled = True
|
Dim oHandle = SplashScreenManager.ShowOverlayForm(Me)
|
||||||
RibbonPageEnvelopeActions.Enabled = True
|
Try
|
||||||
Select Case XtraTabControlMain.SelectedTabPageIndex
|
RibbonPageGroupFunctions.Enabled = True
|
||||||
Case 1
|
RibbonPageEnvelopeActions.Enabled = True
|
||||||
btnEditEnvelope.Enabled = False
|
Select Case XtraTabControlMain.SelectedTabPageIndex
|
||||||
btnDeleteEnvelope.Enabled = False
|
Case 1
|
||||||
btnContactReceiver.Enabled = False
|
btnEditEnvelope.Enabled = False
|
||||||
btnShowDocument.Enabled = False
|
btnDeleteEnvelope.Enabled = False
|
||||||
bbtnitm_ResendInvitation.Enabled = False
|
btnContactReceiver.Enabled = False
|
||||||
bbtnitmInfoMail.Enabled = False
|
btnShowDocument.Enabled = False
|
||||||
bbtnitmEB.Enabled = True
|
bbtnitm_ResendInvitation.Enabled = False
|
||||||
LoadEnvelopeData()
|
bbtnitmInfoMail.Enabled = False
|
||||||
Case 0
|
bbtnitmEB.Enabled = True
|
||||||
If ViewEnvelopes.RowCount = 0 Then
|
LoadEnvelopeData()
|
||||||
RibbonPageGroupFunctions.Enabled = False
|
Case 0
|
||||||
End If
|
If ViewEnvelopes.RowCount = 0 Then
|
||||||
btnEditEnvelope.Enabled = True
|
RibbonPageGroupFunctions.Enabled = False
|
||||||
btnDeleteEnvelope.Enabled = True
|
End If
|
||||||
btnContactReceiver.Enabled = True
|
btnEditEnvelope.Enabled = True
|
||||||
btnShowDocument.Enabled = True
|
btnDeleteEnvelope.Enabled = True
|
||||||
bbtnitm_ResendInvitation.Enabled = True
|
btnContactReceiver.Enabled = True
|
||||||
bbtnitmInfoMail.Enabled = True
|
btnShowDocument.Enabled = True
|
||||||
bbtnitmEB.Enabled = False
|
bbtnitm_ResendInvitation.Enabled = True
|
||||||
LoadEnvelopeData()
|
bbtnitmInfoMail.Enabled = True
|
||||||
txtEnvelopeIdLabel.Caption = "No Envelope selected"
|
bbtnitmEB.Enabled = False
|
||||||
|
LoadEnvelopeData()
|
||||||
|
txtEnvelopeIdLabel.Caption = "No Envelope selected"
|
||||||
|
|
||||||
|
Case 2
|
||||||
|
RibbonPageGroupFunctions.Enabled = False
|
||||||
|
RibbonPageEnvelopeActions.Enabled = False
|
||||||
|
End Select
|
||||||
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex)
|
||||||
|
Finally
|
||||||
|
SplashScreenManager.CloseOverlayForm(oHandle)
|
||||||
|
End Try
|
||||||
|
|
||||||
Case 2
|
|
||||||
RibbonPageGroupFunctions.Enabled = False
|
|
||||||
RibbonPageEnvelopeActions.Enabled = False
|
|
||||||
End Select
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
|
||||||
@@ -621,7 +633,9 @@ Public Class frmMain
|
|||||||
If SQL_REP_ENV_USER_TM <> String.Empty Then
|
If SQL_REP_ENV_USER_TM <> String.Empty Then
|
||||||
Result_Execute(SQL_REP_ENV_USER_TM)
|
Result_Execute(SQL_REP_ENV_USER_TM)
|
||||||
Else
|
Else
|
||||||
|
|
||||||
GridControlData.DataSource = Nothing
|
GridControlData.DataSource = Nothing
|
||||||
|
GridViewData.Columns.Clear()
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -652,7 +666,9 @@ Public Class frmMain
|
|||||||
Try
|
Try
|
||||||
Dim oDT As DataTable = DB_DD_ECM.GetDatatable(mySQL)
|
Dim oDT As DataTable = DB_DD_ECM.GetDatatable(mySQL)
|
||||||
If Not IsNothing(oDT) Then
|
If Not IsNothing(oDT) Then
|
||||||
|
If GridViewData.Columns.Count > 0 Then
|
||||||
|
GridViewData.Columns.Clear()
|
||||||
|
End If
|
||||||
GridControlData.DataSource = oDT
|
GridControlData.DataSource = oDT
|
||||||
Else
|
Else
|
||||||
GridControlData.DataSource = Nothing
|
GridControlData.DataSource = Nothing
|
||||||
@@ -734,4 +750,20 @@ Public Class frmMain
|
|||||||
Public Shared Sub Save_Logfiles()
|
Public Shared Sub Save_Logfiles()
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnEvvallUs_thismonth_Click(sender As Object, e As EventArgs) Handles btnEvvallUs_thismonth.Click
|
||||||
|
If SQL_REP_ENV_ALL_USER_MONTH <> String.Empty Then
|
||||||
|
Result_Execute(SQL_REP_ENV_ALL_USER_MONTH)
|
||||||
|
Else
|
||||||
|
GridControlData.DataSource = Nothing
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnEvvallUs_lastmonth_Click(sender As Object, e As EventArgs) Handles btnEvvallUs_lastmonth.Click
|
||||||
|
If SQL_REP_ENV_ALL_USER_LAST_MONTH <> String.Empty Then
|
||||||
|
Result_Execute(SQL_REP_ENV_ALL_USER_LAST_MONTH)
|
||||||
|
Else
|
||||||
|
GridControlData.DataSource = Nothing
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
62
EnvelopeGenerator.Form/frmRueckruf.Designer.vb
generated
62
EnvelopeGenerator.Form/frmRueckruf.Designer.vb
generated
@@ -30,13 +30,17 @@ Partial Class frmRueckruf
|
|||||||
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
|
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
|
||||||
Me.tsstatus = New System.Windows.Forms.ToolStripStatusLabel()
|
Me.tsstatus = New System.Windows.Forms.ToolStripStatusLabel()
|
||||||
Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton()
|
Me.SimpleButton1 = New DevExpress.XtraEditors.SimpleButton()
|
||||||
|
Me.Label3 = New System.Windows.Forms.Label()
|
||||||
|
Me.Label4 = New System.Windows.Forms.Label()
|
||||||
|
Me.lblID = New System.Windows.Forms.Label()
|
||||||
|
Me.lblTitle = New System.Windows.Forms.Label()
|
||||||
Me.StatusStrip1.SuspendLayout()
|
Me.StatusStrip1.SuspendLayout()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'Label2
|
'Label2
|
||||||
'
|
'
|
||||||
Me.Label2.AutoSize = True
|
Me.Label2.AutoSize = True
|
||||||
Me.Label2.Location = New System.Drawing.Point(22, 20)
|
Me.Label2.Location = New System.Drawing.Point(28, 36)
|
||||||
Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
|
Me.Label2.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0)
|
||||||
Me.Label2.Name = "Label2"
|
Me.Label2.Name = "Label2"
|
||||||
Me.Label2.Size = New System.Drawing.Size(380, 16)
|
Me.Label2.Size = New System.Drawing.Size(380, 16)
|
||||||
@@ -46,7 +50,7 @@ Partial Class frmRueckruf
|
|||||||
'txtReason
|
'txtReason
|
||||||
'
|
'
|
||||||
Me.txtReason.AcceptsReturn = True
|
Me.txtReason.AcceptsReturn = True
|
||||||
Me.txtReason.Location = New System.Drawing.Point(25, 40)
|
Me.txtReason.Location = New System.Drawing.Point(31, 56)
|
||||||
Me.txtReason.Margin = New System.Windows.Forms.Padding(4)
|
Me.txtReason.Margin = New System.Windows.Forms.Padding(4)
|
||||||
Me.txtReason.Multiline = True
|
Me.txtReason.Multiline = True
|
||||||
Me.txtReason.Name = "txtReason"
|
Me.txtReason.Name = "txtReason"
|
||||||
@@ -66,7 +70,7 @@ Partial Class frmRueckruf
|
|||||||
'
|
'
|
||||||
Me.btnCancel.Image = CType(resources.GetObject("btnCancel.Image"), System.Drawing.Image)
|
Me.btnCancel.Image = CType(resources.GetObject("btnCancel.Image"), System.Drawing.Image)
|
||||||
Me.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
Me.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
|
||||||
Me.btnCancel.Location = New System.Drawing.Point(251, 134)
|
Me.btnCancel.Location = New System.Drawing.Point(260, 150)
|
||||||
Me.btnCancel.Name = "btnCancel"
|
Me.btnCancel.Name = "btnCancel"
|
||||||
Me.btnCancel.Size = New System.Drawing.Size(203, 44)
|
Me.btnCancel.Size = New System.Drawing.Size(203, 44)
|
||||||
Me.btnCancel.TabIndex = 4
|
Me.btnCancel.TabIndex = 4
|
||||||
@@ -76,7 +80,7 @@ Partial Class frmRueckruf
|
|||||||
'StatusStrip1
|
'StatusStrip1
|
||||||
'
|
'
|
||||||
Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsstatus})
|
Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsstatus})
|
||||||
Me.StatusStrip1.Location = New System.Drawing.Point(0, 185)
|
Me.StatusStrip1.Location = New System.Drawing.Point(0, 211)
|
||||||
Me.StatusStrip1.Name = "StatusStrip1"
|
Me.StatusStrip1.Name = "StatusStrip1"
|
||||||
Me.StatusStrip1.Size = New System.Drawing.Size(488, 22)
|
Me.StatusStrip1.Size = New System.Drawing.Size(488, 22)
|
||||||
Me.StatusStrip1.TabIndex = 5
|
Me.StatusStrip1.TabIndex = 5
|
||||||
@@ -90,17 +94,59 @@ Partial Class frmRueckruf
|
|||||||
'SimpleButton1
|
'SimpleButton1
|
||||||
'
|
'
|
||||||
Me.SimpleButton1.ImageOptions.SvgImage = CType(resources.GetObject("SimpleButton1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
|
Me.SimpleButton1.ImageOptions.SvgImage = CType(resources.GetObject("SimpleButton1.ImageOptions.SvgImage"), DevExpress.Utils.Svg.SvgImage)
|
||||||
Me.SimpleButton1.Location = New System.Drawing.Point(25, 134)
|
Me.SimpleButton1.Location = New System.Drawing.Point(31, 150)
|
||||||
Me.SimpleButton1.Name = "SimpleButton1"
|
Me.SimpleButton1.Name = "SimpleButton1"
|
||||||
Me.SimpleButton1.Size = New System.Drawing.Size(220, 44)
|
Me.SimpleButton1.Size = New System.Drawing.Size(220, 44)
|
||||||
Me.SimpleButton1.TabIndex = 6
|
Me.SimpleButton1.TabIndex = 6
|
||||||
Me.SimpleButton1.Text = "Umschlag zurückrufen"
|
Me.SimpleButton1.Text = "Umschlag zurückrufen"
|
||||||
'
|
'
|
||||||
|
'Label3
|
||||||
|
'
|
||||||
|
Me.Label3.AutoSize = True
|
||||||
|
Me.Label3.Location = New System.Drawing.Point(28, 9)
|
||||||
|
Me.Label3.Name = "Label3"
|
||||||
|
Me.Label3.Size = New System.Drawing.Size(80, 16)
|
||||||
|
Me.Label3.TabIndex = 7
|
||||||
|
Me.Label3.Text = "Envelope-ID:"
|
||||||
|
'
|
||||||
|
'Label4
|
||||||
|
'
|
||||||
|
Me.Label4.AutoSize = True
|
||||||
|
Me.Label4.Location = New System.Drawing.Point(158, 9)
|
||||||
|
Me.Label4.Name = "Label4"
|
||||||
|
Me.Label4.Size = New System.Drawing.Size(93, 16)
|
||||||
|
Me.Label4.TabIndex = 8
|
||||||
|
Me.Label4.Text = "Envelope-Titel:"
|
||||||
|
'
|
||||||
|
'lblID
|
||||||
|
'
|
||||||
|
Me.lblID.AutoSize = True
|
||||||
|
Me.lblID.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.lblID.Location = New System.Drawing.Point(108, 9)
|
||||||
|
Me.lblID.Name = "lblID"
|
||||||
|
Me.lblID.Size = New System.Drawing.Size(49, 16)
|
||||||
|
Me.lblID.TabIndex = 9
|
||||||
|
Me.lblID.Text = "Label5"
|
||||||
|
'
|
||||||
|
'lblTitle
|
||||||
|
'
|
||||||
|
Me.lblTitle.AutoSize = True
|
||||||
|
Me.lblTitle.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||||
|
Me.lblTitle.Location = New System.Drawing.Point(257, 9)
|
||||||
|
Me.lblTitle.Name = "lblTitle"
|
||||||
|
Me.lblTitle.Size = New System.Drawing.Size(49, 16)
|
||||||
|
Me.lblTitle.TabIndex = 10
|
||||||
|
Me.lblTitle.Text = "Label5"
|
||||||
|
'
|
||||||
'frmRueckruf
|
'frmRueckruf
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 16.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.ClientSize = New System.Drawing.Size(488, 207)
|
Me.ClientSize = New System.Drawing.Size(488, 233)
|
||||||
|
Me.Controls.Add(Me.lblTitle)
|
||||||
|
Me.Controls.Add(Me.lblID)
|
||||||
|
Me.Controls.Add(Me.Label4)
|
||||||
|
Me.Controls.Add(Me.Label3)
|
||||||
Me.Controls.Add(Me.SimpleButton1)
|
Me.Controls.Add(Me.SimpleButton1)
|
||||||
Me.Controls.Add(Me.StatusStrip1)
|
Me.Controls.Add(Me.StatusStrip1)
|
||||||
Me.Controls.Add(Me.btnCancel)
|
Me.Controls.Add(Me.btnCancel)
|
||||||
@@ -129,4 +175,8 @@ Partial Class frmRueckruf
|
|||||||
Friend WithEvents StatusStrip1 As StatusStrip
|
Friend WithEvents StatusStrip1 As StatusStrip
|
||||||
Friend WithEvents tsstatus As ToolStripStatusLabel
|
Friend WithEvents tsstatus As ToolStripStatusLabel
|
||||||
Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton
|
Friend WithEvents SimpleButton1 As DevExpress.XtraEditors.SimpleButton
|
||||||
|
Friend WithEvents Label3 As Label
|
||||||
|
Friend WithEvents Label4 As Label
|
||||||
|
Friend WithEvents lblID As Label
|
||||||
|
Friend WithEvents lblTitle As Label
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
<data name="btnCancel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="btnCancel.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
<value>
|
<value>
|
||||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||||
wQAADsEBuJFr7QAAAUlJREFUOE+lU6GOg1AQ5BP6Cf2E+4QLnqQWV4EHjUJhGzxJJbICDxpFQvCHg4DA
|
wAAADsABataJCQAAAUlJREFUOE+lU6GOg1AQ5BP6Cf2E+4QLnqQWV4EHjUJhGzxJJbICDxpFQvCHg4DA
|
||||||
Yd/tLPvK4wJ34iaZ9GVndxh4WwtYluVCfBIVcSYGLPwA1SPp0bxpIaiqSjmOw2zbdhMJdL4S6yzLlG3b
|
Yd/tLPvK4wJ34iaZ9GVndxh4WwtYluVCfBIVcSYGLPwA1SPp0bxpIaiqSjmOw2zbdhMJdL4S6yzLlG3b
|
||||||
qigK6JHI3FCmacoi6HmeGscRSZAswDmOY9bQR7WXjK5AExJoAzBJEjTOXdexIWowoVpNvMjoChQg5Hm+
|
qigK6JHI3FCmacoi6HmeGscRSZAswDmOY9bQR7WXjK5AExJoAzBJEjTOXdexIWowoVpNvMjoChQg5Hm+
|
||||||
M8HT8Eo4G6muMrbHmQkIk2ma8PRPaT8G3Ikc1TSAKdWf0nYMGT5M4Lrun/E/iDM+nDlofgPf9/kDysgG
|
M8HT8Eo4G6muMrbHmQkIk2ma8PRPaT8G3Ikc1TSAKdWf0nYMGT5M4Lrun/E/iDM+nDlofgPf9/kDysgG
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ Public Class frmRueckruf
|
|||||||
txtReason.Text = ""
|
txtReason.Text = ""
|
||||||
tsstatus.Text = ""
|
tsstatus.Text = ""
|
||||||
Continue_Reject = False
|
Continue_Reject = False
|
||||||
|
lblID.Text = CurrentEnvelopID.ToString
|
||||||
|
lblTitle.Text = CurrentEnvelopetitle
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click
|
Private Sub SimpleButton1_Click(sender As Object, e As EventArgs) Handles SimpleButton1.Click
|
||||||
@@ -50,4 +52,8 @@ Public Class frmRueckruf
|
|||||||
tsstatus.Text = "Please add a reason for aborting - " & Now
|
tsstatus.Text = "Please add a reason for aborting - " & Now
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
|
||||||
|
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using EnvelopeGenerator.Web.Models;
|
using EnvelopeGenerator.Web.Models.Annotation;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
@@ -6,6 +7,7 @@ namespace EnvelopeGenerator.Web.Controllers;
|
|||||||
|
|
||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
|
[Authorize]
|
||||||
public class ConfigController : ControllerBase
|
public class ConfigController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly AnnotationParams _annotParams;
|
private readonly AnnotationParams _annotParams;
|
||||||
@@ -18,6 +20,6 @@ public class ConfigController : ControllerBase
|
|||||||
[HttpGet("Annotations")]
|
[HttpGet("Annotations")]
|
||||||
public IActionResult GetAnnotationParams()
|
public IActionResult GetAnnotationParams()
|
||||||
{
|
{
|
||||||
return Ok(_annotParams.AnnotationDictionary);
|
return Ok(_annotParams.AnnotationJSObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<PackageId>EnvelopeGenerator.Web</PackageId>
|
<PackageId>EnvelopeGenerator.Web</PackageId>
|
||||||
<Version>3.1.1</Version>
|
<Version>3.1.2</Version>
|
||||||
<Authors>Digital Data GmbH</Authors>
|
<Authors>Digital Data GmbH</Authors>
|
||||||
<Company>Digital Data GmbH</Company>
|
<Company>Digital Data GmbH</Company>
|
||||||
<Product>EnvelopeGenerator.Web</Product>
|
<Product>EnvelopeGenerator.Web</Product>
|
||||||
@@ -13,8 +13,8 @@
|
|||||||
<PackageTags>digital data envelope generator web</PackageTags>
|
<PackageTags>digital data envelope generator web</PackageTags>
|
||||||
<Description>EnvelopeGenerator.Web is an ASP.NET MVC application developed to manage signing processes. It uses Entity Framework Core (EF Core) for database operations. The user interface for signing processes is developed with Razor View Engine (.cshtml files) and JavaScript under wwwroot, integrated with PSPDFKit. This integration allows users to view and sign documents seamlessly.</Description>
|
<Description>EnvelopeGenerator.Web is an ASP.NET MVC application developed to manage signing processes. It uses Entity Framework Core (EF Core) for database operations. The user interface for signing processes is developed with Razor View Engine (.cshtml files) and JavaScript under wwwroot, integrated with PSPDFKit. This integration allows users to view and sign documents seamlessly.</Description>
|
||||||
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
|
||||||
<AssemblyVersion>3.1.1</AssemblyVersion>
|
<AssemblyVersion>3.1.2</AssemblyVersion>
|
||||||
<FileVersion>3.1.1</FileVersion>
|
<FileVersion>3.1.2</FileVersion>
|
||||||
<Copyright>Copyright © 2025 Digital Data GmbH. All rights reserved.</Copyright>
|
<Copyright>Copyright © 2025 Digital Data GmbH. All rights reserved.</Copyright>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Web.Models;
|
namespace EnvelopeGenerator.Web.Models.Annotation;
|
||||||
|
|
||||||
public record Annotation
|
public record Annotation : IAnnotation
|
||||||
{
|
{
|
||||||
public required string Name { get; init; }
|
public required string Name { get; init; }
|
||||||
|
|
||||||
@@ -60,6 +60,16 @@ public record Annotation
|
|||||||
public Annotation? VerBoundAnnot { get; set; }
|
public Annotation? VerBoundAnnot { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public Color? BackgroundColor { get; init; }
|
||||||
|
|
||||||
|
#region Border
|
||||||
|
public Color? BorderColor { get; init; }
|
||||||
|
|
||||||
|
public string? BorderStyle { get; init; }
|
||||||
|
|
||||||
|
public int? BorderWidth { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
internal Annotation Default
|
internal Annotation Default
|
||||||
{
|
{
|
||||||
@@ -1,15 +1,21 @@
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
namespace EnvelopeGenerator.Web.Models;
|
namespace EnvelopeGenerator.Web.Models.Annotation;
|
||||||
|
|
||||||
public class AnnotationParams
|
public class AnnotationParams
|
||||||
{
|
{
|
||||||
|
public AnnotationParams()
|
||||||
|
{
|
||||||
|
_AnnotationJSObjectInitor = new(CreateAnnotationJSObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Background? Background { get; init; }
|
||||||
|
|
||||||
|
#region Annotation
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Annotation? DefaultAnnotation { get; init; }
|
public Annotation? DefaultAnnotation { get; init; }
|
||||||
|
|
||||||
private readonly IEnumerable<Annotation> _annots = new List<Annotation>();
|
private readonly List<Annotation> _annots = new List<Annotation>();
|
||||||
|
|
||||||
public Annotation this[string name] => _annots.First(a => a.Name == name);
|
|
||||||
|
|
||||||
public bool TryGet(string name, out Annotation annotation)
|
public bool TryGet(string name, out Annotation annotation)
|
||||||
{
|
{
|
||||||
@@ -24,34 +30,50 @@ public class AnnotationParams
|
|||||||
get => _annots;
|
get => _annots;
|
||||||
init
|
init
|
||||||
{
|
{
|
||||||
_annots = value;
|
_annots = value.ToList();
|
||||||
|
|
||||||
if (DefaultAnnotation is not null)
|
if (DefaultAnnotation is not null)
|
||||||
foreach (var annot in _annots)
|
foreach (var annot in _annots)
|
||||||
annot.Default = DefaultAnnotation;
|
annot.Default = DefaultAnnotation;
|
||||||
|
|
||||||
foreach (var annot in _annots)
|
for (int i = 0; i < _annots.Count; i++)
|
||||||
{
|
{
|
||||||
#region set bound annotations
|
#region set bound annotations
|
||||||
// horizontal
|
// horizontal
|
||||||
if (annot.HorBoundAnnotName is string horBoundAnnotName)
|
if (_annots[i].HorBoundAnnotName is string horBoundAnnotName)
|
||||||
if (TryGet(horBoundAnnotName, out var horBoundAnnot))
|
if (TryGet(horBoundAnnotName, out var horBoundAnnot))
|
||||||
annot.HorBoundAnnot = horBoundAnnot;
|
_annots[i].HorBoundAnnot = horBoundAnnot;
|
||||||
else
|
else
|
||||||
throw new InvalidOperationException($"{horBoundAnnotName} added as bound anotation. However, it is not defined.");
|
throw new InvalidOperationException($"{horBoundAnnotName} added as bound anotation. However, it is not defined.");
|
||||||
|
|
||||||
// vertical
|
// vertical
|
||||||
if (annot.VerBoundAnnotName is string verBoundAnnotName)
|
if (_annots[i].VerBoundAnnotName is string verBoundAnnotName)
|
||||||
if (TryGet(verBoundAnnotName, out var verBoundAnnot))
|
if (TryGet(verBoundAnnotName, out var verBoundAnnot))
|
||||||
annot.VerBoundAnnot = verBoundAnnot;
|
_annots[i].VerBoundAnnot = verBoundAnnot;
|
||||||
else
|
else
|
||||||
throw new InvalidOperationException($"{verBoundAnnotName} added as bound anotation. However, it is not defined.");
|
throw new InvalidOperationException($"{verBoundAnnotName} added as bound anotation. However, it is not defined.");
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
AnnotationDictionary = _annots.ToDictionary(a => a.Name.ToLower(), a => a);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
public Dictionary<string, Annotation> AnnotationDictionary { get; private init; } = new();
|
#region AnnotationJSObject
|
||||||
|
private Dictionary<string, IAnnotation> CreateAnnotationJSObject()
|
||||||
|
{
|
||||||
|
var dict = _annots.ToDictionary(a => a.Name.ToLower(), a => a as IAnnotation);
|
||||||
|
|
||||||
|
if (Background is not null)
|
||||||
|
{
|
||||||
|
Background.Locate(_annots);
|
||||||
|
dict.Add(Background.Name.ToLower(), Background);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dict;
|
||||||
|
}
|
||||||
|
|
||||||
|
private readonly Lazy<Dictionary<string, IAnnotation>> _AnnotationJSObjectInitor;
|
||||||
|
|
||||||
|
public Dictionary<string, IAnnotation> AnnotationJSObject => _AnnotationJSObjectInitor.Value;
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
58
EnvelopeGenerator.Web/Models/Annotation/Background.cs
Normal file
58
EnvelopeGenerator.Web/Models/Annotation/Background.cs
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
|
namespace EnvelopeGenerator.Web.Models.Annotation;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The Background is an annotation for the PSPDF Kit. However, it has no function.
|
||||||
|
/// It is only the first annotation as a background for other annotations.
|
||||||
|
/// </summary>
|
||||||
|
public record Background : IAnnotation
|
||||||
|
{
|
||||||
|
[JsonIgnore]
|
||||||
|
public double Margin { get; init; }
|
||||||
|
|
||||||
|
public string Name { get; } = "Background";
|
||||||
|
|
||||||
|
public double? Width { get; set; }
|
||||||
|
|
||||||
|
public double? Height { get; set; }
|
||||||
|
|
||||||
|
public double Left { get; set; }
|
||||||
|
|
||||||
|
public double Top { get; set; }
|
||||||
|
|
||||||
|
public Color? BackgroundColor { get; init; }
|
||||||
|
|
||||||
|
#region Border
|
||||||
|
public Color? BorderColor { get; init; }
|
||||||
|
|
||||||
|
public string? BorderStyle { get; init; }
|
||||||
|
|
||||||
|
public int? BorderWidth { get; set; }
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public void Locate(IEnumerable<IAnnotation> annotations)
|
||||||
|
{
|
||||||
|
// set Top
|
||||||
|
if (annotations.MinBy(a => a.Top)?.Top is double minTop)
|
||||||
|
Top = minTop;
|
||||||
|
|
||||||
|
// set Left
|
||||||
|
if (annotations.MinBy(a => a.Left)?.Left is double minLeft)
|
||||||
|
Left = minLeft;
|
||||||
|
|
||||||
|
// set Width
|
||||||
|
if(annotations.MaxBy(a => a.GetRight())?.GetRight() is double maxRight)
|
||||||
|
Width = maxRight - Left;
|
||||||
|
|
||||||
|
// set Height
|
||||||
|
if (annotations.MaxBy(a => a.GetBottom())?.GetBottom() is double maxBottom)
|
||||||
|
Height = maxBottom - Top;
|
||||||
|
|
||||||
|
// add margins
|
||||||
|
Top -= Margin;
|
||||||
|
Left -= Margin;
|
||||||
|
Width += Margin * 2;
|
||||||
|
Height += Margin * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
10
EnvelopeGenerator.Web/Models/Annotation/Color.cs
Normal file
10
EnvelopeGenerator.Web/Models/Annotation/Color.cs
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
namespace EnvelopeGenerator.Web.Models.Annotation;
|
||||||
|
|
||||||
|
public record Color
|
||||||
|
{
|
||||||
|
public int R { get; init; } = 0;
|
||||||
|
|
||||||
|
public int G { get; init; } = 0;
|
||||||
|
|
||||||
|
public int B { get; init; } = 0;
|
||||||
|
}
|
||||||
8
EnvelopeGenerator.Web/Models/Annotation/Extensions.cs
Normal file
8
EnvelopeGenerator.Web/Models/Annotation/Extensions.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace EnvelopeGenerator.Web.Models.Annotation;
|
||||||
|
|
||||||
|
public static class Extensions
|
||||||
|
{
|
||||||
|
public static double GetRight(this IAnnotation annotation) => annotation.Left + annotation?.Width ?? 0;
|
||||||
|
|
||||||
|
public static double GetBottom(this IAnnotation annotation) => annotation.Top + annotation?.Height ?? 0;
|
||||||
|
}
|
||||||
22
EnvelopeGenerator.Web/Models/Annotation/IAnnotation.cs
Normal file
22
EnvelopeGenerator.Web/Models/Annotation/IAnnotation.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
namespace EnvelopeGenerator.Web.Models.Annotation;
|
||||||
|
|
||||||
|
public interface IAnnotation
|
||||||
|
{
|
||||||
|
string Name { get; }
|
||||||
|
|
||||||
|
double? Width { get; }
|
||||||
|
|
||||||
|
double? Height { get; }
|
||||||
|
|
||||||
|
double Left { get; }
|
||||||
|
|
||||||
|
double Top { get; }
|
||||||
|
|
||||||
|
Color? BackgroundColor { get; }
|
||||||
|
|
||||||
|
Color? BorderColor { get; }
|
||||||
|
|
||||||
|
string? BorderStyle { get; }
|
||||||
|
|
||||||
|
int? BorderWidth { get; }
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@ using DigitalData.EmailProfilerDispatcher;
|
|||||||
using EnvelopeGenerator.Infrastructure;
|
using EnvelopeGenerator.Infrastructure;
|
||||||
using EnvelopeGenerator.Web.Sanitizers;
|
using EnvelopeGenerator.Web.Sanitizers;
|
||||||
using EnvelopeGenerator.Application.Contracts.Services;
|
using EnvelopeGenerator.Application.Contracts.Services;
|
||||||
|
using EnvelopeGenerator.Web.Models.Annotation;
|
||||||
|
|
||||||
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
|
||||||
logger.Info("Logging initialized!");
|
logger.Info("Logging initialized!");
|
||||||
|
|||||||
@@ -151,6 +151,21 @@
|
|||||||
},
|
},
|
||||||
"MainPageTitle": null,
|
"MainPageTitle": null,
|
||||||
"AnnotationParams": {
|
"AnnotationParams": {
|
||||||
|
"Background": {
|
||||||
|
"Margin": 0.20,
|
||||||
|
"BackgroundColor": {
|
||||||
|
"R": 222,
|
||||||
|
"G": 220,
|
||||||
|
"B": 215
|
||||||
|
},
|
||||||
|
"BorderColor": {
|
||||||
|
"R": 204,
|
||||||
|
"G": 202,
|
||||||
|
"B": 198
|
||||||
|
},
|
||||||
|
"BorderStyle": "underline",
|
||||||
|
"BorderWidth": 4
|
||||||
|
},
|
||||||
"DefaultAnnotation": {
|
"DefaultAnnotation": {
|
||||||
"Width": 1,
|
"Width": 1,
|
||||||
"Height": 0.5,
|
"Height": 0.5,
|
||||||
|
|||||||
@@ -6,14 +6,42 @@ async function createAnnotations(document, instance) {
|
|||||||
const annotParams = await getAnnotationParams(element.left, element.top);
|
const annotParams = await getAnnotationParams(element.left, element.top);
|
||||||
const page = element.page - 1
|
const page = element.page - 1
|
||||||
|
|
||||||
|
//background
|
||||||
|
if(annotParams.background){
|
||||||
|
let background = annotParams.background;
|
||||||
|
const id_background = PSPDFKit.generateInstantId();
|
||||||
|
const annotation_background = new PSPDFKit.Annotations.WidgetAnnotation({
|
||||||
|
id: id_background,
|
||||||
|
pageIndex: page,
|
||||||
|
formFieldName: id_background,
|
||||||
|
backgroundColor: background?.backgroundColor ? new PSPDFKit.Color(background.backgroundColor) : null,
|
||||||
|
blendMode: 'normal',
|
||||||
|
boundingBox: new PSPDFKit.Geometry.Rect(background),
|
||||||
|
fontSize: 8,
|
||||||
|
borderStyle: background.borderStyle,
|
||||||
|
borderWidth: background.borderWidth,
|
||||||
|
borderColor: background?.borderColor ? new PSPDFKit.Color(background.borderColor) : null
|
||||||
|
});
|
||||||
|
|
||||||
|
const formFieldBackground = new PSPDFKit.FormFields.ButtonFormField({
|
||||||
|
name: id_background,
|
||||||
|
annotationIds: PSPDFKit.Immutable.List([annotation_background.id]),
|
||||||
|
value: "",
|
||||||
|
readOnly: false
|
||||||
|
});
|
||||||
|
|
||||||
|
signatures.push(annotation_background)
|
||||||
|
signatures.push(formFieldBackground)
|
||||||
|
}
|
||||||
|
|
||||||
//signatures
|
//signatures
|
||||||
const id = PSPDFKit.generateInstantId()
|
const id = PSPDFKit.generateInstantId()
|
||||||
const annotation = new PSPDFKit.Annotations.WidgetAnnotation({
|
const annotation = new PSPDFKit.Annotations.WidgetAnnotation({
|
||||||
id: id,
|
id: id,
|
||||||
pageIndex: page,
|
pageIndex: page,
|
||||||
formFieldName: id,
|
formFieldName: id,
|
||||||
backgroundColor: PSPDFKit.Color.YELLOW,
|
backgroundColor: PSPDFKit.Color.LIGHT_YELLOW,
|
||||||
blendMode: 'multiply',
|
blendMode: 'normal',
|
||||||
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.signature),
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.signature),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -29,7 +57,7 @@ async function createAnnotations(document, instance) {
|
|||||||
pageIndex: page,
|
pageIndex: page,
|
||||||
formFieldName: id_position,
|
formFieldName: id_position,
|
||||||
backgroundColor: PSPDFKit.Color.DarkBlue,
|
backgroundColor: PSPDFKit.Color.DarkBlue,
|
||||||
blendMode: 'multiply',
|
blendMode: 'normal',
|
||||||
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.position),
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.position),
|
||||||
fontSize: 8
|
fontSize: 8
|
||||||
})
|
})
|
||||||
@@ -48,7 +76,7 @@ async function createAnnotations(document, instance) {
|
|||||||
pageIndex: page,
|
pageIndex: page,
|
||||||
formFieldName: id_city,
|
formFieldName: id_city,
|
||||||
backgroundColor: PSPDFKit.Color.DarkBlue,
|
backgroundColor: PSPDFKit.Color.DarkBlue,
|
||||||
blendMode: 'multiply',
|
blendMode: 'normal',
|
||||||
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.city),
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.city),
|
||||||
fontSize: 8
|
fontSize: 8
|
||||||
})
|
})
|
||||||
@@ -67,7 +95,7 @@ async function createAnnotations(document, instance) {
|
|||||||
pageIndex: page,
|
pageIndex: page,
|
||||||
formFieldName: id_date,
|
formFieldName: id_date,
|
||||||
backgroundColor: PSPDFKit.Color.DarkBlue,
|
backgroundColor: PSPDFKit.Color.DarkBlue,
|
||||||
blendMode: 'multiply',
|
blendMode: 'normal',
|
||||||
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.date),
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.date),
|
||||||
fontSize: 8,
|
fontSize: 8,
|
||||||
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
||||||
@@ -97,7 +125,7 @@ async function createAnnotations(document, instance) {
|
|||||||
id: id_date_label,
|
id: id_date_label,
|
||||||
pageIndex: page,
|
pageIndex: page,
|
||||||
formFieldName: id_date_label,
|
formFieldName: id_date_label,
|
||||||
blendMode: 'multiply',
|
blendMode: 'normal',
|
||||||
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.datelabel),
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.datelabel),
|
||||||
fontSize: 8,
|
fontSize: 8,
|
||||||
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
||||||
@@ -119,7 +147,7 @@ async function createAnnotations(document, instance) {
|
|||||||
id: id_city_label,
|
id: id_city_label,
|
||||||
pageIndex: page,
|
pageIndex: page,
|
||||||
formFieldName: id_city_label,
|
formFieldName: id_city_label,
|
||||||
blendMode: 'multiply',
|
blendMode: 'normal',
|
||||||
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.citylabel),
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.citylabel),
|
||||||
fontSize: 8,
|
fontSize: 8,
|
||||||
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
||||||
@@ -131,7 +159,8 @@ async function createAnnotations(document, instance) {
|
|||||||
name: id_city_label,
|
name: id_city_label,
|
||||||
annotationIds: PSPDFKit.Immutable.List([annotation_city_label.id]),
|
annotationIds: PSPDFKit.Immutable.List([annotation_city_label.id]),
|
||||||
value: "Ort",
|
value: "Ort",
|
||||||
readOnly: true
|
readOnly: true,
|
||||||
|
color: PSPDFKit.Color.BLACK
|
||||||
})
|
})
|
||||||
|
|
||||||
//position label
|
//position label
|
||||||
@@ -140,7 +169,7 @@ async function createAnnotations(document, instance) {
|
|||||||
id: id_position_label,
|
id: id_position_label,
|
||||||
pageIndex: page,
|
pageIndex: page,
|
||||||
formFieldName: id_position_label,
|
formFieldName: id_position_label,
|
||||||
blendMode: 'multiply',
|
blendMode: 'normal',
|
||||||
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.positionlabel),
|
boundingBox: new PSPDFKit.Geometry.Rect(annotParams.positionlabel),
|
||||||
fontSize: 8,
|
fontSize: 8,
|
||||||
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
backgroundColor: PSPDFKit.Color.TRANSPARENT,
|
||||||
|
|||||||
@@ -175,21 +175,21 @@ async function setLanguage(language) {
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(langs => langs.includes(language))
|
.then(langs => langs.includes(language))
|
||||||
.catch(err => false);
|
.catch(err => false);
|
||||||
|
|
||||||
if(hasLang)
|
if (hasLang)
|
||||||
return await fetch(`/lang/${language}`, {
|
return await fetch(`/lang/${language}`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' }
|
headers: { 'Content-Type': 'application/json' }
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.redirected)
|
if (response.redirected)
|
||||||
window.location.href = response.url;
|
window.location.href = response.url;
|
||||||
else if (!response.ok)
|
else if (!response.ok)
|
||||||
return Promise.reject('Failed to set language');
|
return Promise.reject('Failed to set language');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function logout() {
|
async function logout() {
|
||||||
@@ -204,22 +204,23 @@ async function logout() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAnnotationParams(leftInInch = 0, topInInch = 0, inchToPointFactor = 72) {
|
|
||||||
return fetch(`${window.location.origin}/api/Config/Annotations`, {
|
async function getAnnotationParams(leftInInch = 0, topInInch = 0, inchToPointFactor = 72) {
|
||||||
|
|
||||||
|
const annotParams = await fetch(`${window.location.origin}/api/Config/Annotations`, {
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
.then(res => res.json())
|
.then(res => res.json());
|
||||||
.then(annotParams => {
|
|
||||||
for(var key in annotParams){
|
for (var key in annotParams) {
|
||||||
var annot = annotParams[key];
|
var annot = annotParams[key];
|
||||||
annot.width *= inchToPointFactor;
|
annot.width *= inchToPointFactor;
|
||||||
annot.height *= inchToPointFactor;
|
annot.height *= inchToPointFactor;
|
||||||
annot.left += leftInInch;
|
annot.left += leftInInch - 0.7;
|
||||||
annot.left *= inchToPointFactor;
|
annot.left *= inchToPointFactor;
|
||||||
annot.top += topInInch;
|
annot.top += topInInch - 0.5;
|
||||||
annot.top *= inchToPointFactor;
|
annot.top *= inchToPointFactor;
|
||||||
}
|
}
|
||||||
return annotParams;
|
return annotParams;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
async function setLangAsync(n,t){document.getElementById("selectedFlag").className="fi "+t+" me-2";await fetch(`/lang/${n}`,{method:"POST",headers:{"Content-Type":"application/json"}})}async function setLanguage(n){const t=await fetch("/lang",{method:"GET",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(t=>t.includes(n)).catch(()=>!1);if(t)return await fetch(`/lang/${n}`,{method:"POST",headers:{"Content-Type":"application/json"}}).then(n=>{if(n.redirected)window.location.href=n.url;else if(!n.ok)return Promise.reject("Failed to set language")})}async function logout(){return await fetch(`/auth/logout`,{method:"POST",headers:{"Content-Type":"application/json"}}).then(n=>{n.ok&&(window.location.href="/")})}function getAnnotationParams(n=0,t=0,i=72){return fetch(`${window.location.origin}/api/Config/Annotations`,{credentials:"include",method:"GET"}).then(n=>n.json()).then(r=>{var f,u;for(f in r)u=r[f],u.width*=i,u.height*=i,u.left+=n,u.left*=i,u.top+=t,u.top*=i;return r})}class Network{async getEnvelope(n){return this.getRequest(`/api/envelope/${n}`).then(this.wrapJsonResponse.bind(this))}async postEnvelope(n,t,i){return this.postRequest(`/api/envelope/${n}?index=${t}`,i).then(this.wrapJsonResponse.bind(this))}async getDocument(n,t){return this.getRequest(`/api/document/${n}?index=${t}`).then(this.wrapBinaryResponse.bind(this))}async openDocument(n){return this.postRequest(`/api/document/${n}`,{}).then(this.wrapJsonResponse.bind(this))}withCSRFToken(n){const t=getCSRFToken;let i=n.headers;return n.headers={...i,...t},n}getCSRFToken(){const n=document.getElementsByName("__RequestVerificationToken")[0].value;return{"X-XSRF-TOKEN":n}}getRequest(n){const t=this.getCSRFToken(),i={credentials:"include",method:"GET",headers:{...t}};return fetch(n,i)}postRequest(n,t){const i=this.getCSRFToken(),r={credentials:"include",method:"POST",headers:{...i,"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)};return fetch(n,r)}async wrapJsonResponse(n){return await this.wrapResponse(n,async n=>await n.json())}async wrapBinaryResponse(n){return await this.wrapResponse(n,async n=>await n.arrayBuffer())}async wrapResponse(n,t){let i;if(n.status===200){const r=await t(n);i=new WrappedResponse(r,null)}else if(n.status===403){const t=await n.json();i=new WrappedResponse(null,t)}else i=new WrappedResponse(null,null);return i}}class WrappedResponse{constructor(n,t){this.data=n;this.error=t;this.fatal=n===null&&t===null}}
|
async function setLangAsync(n,t){document.getElementById("selectedFlag").className="fi "+t+" me-2";await fetch(`/lang/${n}`,{method:"POST",headers:{"Content-Type":"application/json"}})}async function setLanguage(n){const t=await fetch("/lang",{method:"GET",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(t=>t.includes(n)).catch(()=>!1);if(t)return await fetch(`/lang/${n}`,{method:"POST",headers:{"Content-Type":"application/json"}}).then(n=>{if(n.redirected)window.location.href=n.url;else if(!n.ok)return Promise.reject("Failed to set language")})}async function logout(){return await fetch(`/auth/logout`,{method:"POST",headers:{"Content-Type":"application/json"}}).then(n=>{n.ok&&(window.location.href="/")})}async function getAnnotationParams(n=0,t=0,i=72){var f,r;const u=await fetch(`${window.location.origin}/api/Config/Annotations`,{credentials:"include",method:"GET"}).then(n=>n.json());for(f in u)r=u[f],r.width*=i,r.height*=i,r.left+=n-.7,r.left*=i,r.top+=t-.5,r.top*=i;return u}class Network{async getEnvelope(n){return this.getRequest(`/api/envelope/${n}`).then(this.wrapJsonResponse.bind(this))}async postEnvelope(n,t,i){return this.postRequest(`/api/envelope/${n}?index=${t}`,i).then(this.wrapJsonResponse.bind(this))}async getDocument(n,t){return this.getRequest(`/api/document/${n}?index=${t}`).then(this.wrapBinaryResponse.bind(this))}async openDocument(n){return this.postRequest(`/api/document/${n}`,{}).then(this.wrapJsonResponse.bind(this))}withCSRFToken(n){const t=getCSRFToken;let i=n.headers;return n.headers={...i,...t},n}getCSRFToken(){const n=document.getElementsByName("__RequestVerificationToken")[0].value;return{"X-XSRF-TOKEN":n}}getRequest(n){const t=this.getCSRFToken(),i={credentials:"include",method:"GET",headers:{...t}};return fetch(n,i)}postRequest(n,t){const i=this.getCSRFToken(),r={credentials:"include",method:"POST",headers:{...i,"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)};return fetch(n,r)}async wrapJsonResponse(n){return await this.wrapResponse(n,async n=>await n.json())}async wrapBinaryResponse(n){return await this.wrapResponse(n,async n=>await n.arrayBuffer())}async wrapResponse(n,t){let i;if(n.status===200){const r=await t(n);i=new WrappedResponse(r,null)}else if(n.status===403){const t=await n.json();i=new WrappedResponse(null,t)}else i=new WrappedResponse(null,null);return i}}class WrappedResponse{constructor(n,t){this.data=n;this.error=t;this.fatal=n===null&&t===null}}
|
||||||
Reference in New Issue
Block a user