Add Export to Y Conversion to plain PDF

This commit is contained in:
Jonathan Jenne 2023-11-30 11:50:13 +01:00
parent f601485bc4
commit f0a36dc43a
4 changed files with 101 additions and 94 deletions

View File

@ -121,6 +121,7 @@
<File Id="DDCommonGUIs" Name="DigitalData.GUIs.Common.dll" Source="DigitalData.GUIs.Common.dll"/>
<File Id="DDConfig" Name="DigitalData.Modules.Config.dll" Source="DigitalData.Modules.Config.dll"/>
<File Id="DDLogging" Name="DigitalData.Modules.Logging.dll" Source="DigitalData.Modules.Logging.dll"/>
<File Id="DDInterfaces" Name="DigitalData.Modules.Interfaces.dll" Source="DigitalData.Modules.Interfaces.dll"/>
<File Id="DDBase" Name="DigitalData.Modules.Base.dll" Source="DigitalData.Modules.Base.dll"/>
<File Id="DDLanguage" Name="DigitalData.Modules.Language.dll" Source="DigitalData.Modules.Language.dll"/>
<File Id="DDFilesystem" Name="DigitalData.Modules.Filesystem.dll" Source="DigitalData.Modules.Filesystem.dll"/>

View File

@ -173,6 +173,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\DDModules\EDMIAPI\bin\Debug\DigitalData.Modules.EDMI.API.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Interfaces">
<HintPath>..\..\..\DDModules\Interfaces\bin\Debug\DigitalData.Modules.Interfaces.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Language, Version=1.6.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\DDModules\Language\bin\Debug\DigitalData.Modules.Language.dll</HintPath>

View File

@ -3284,12 +3284,4 @@ FROM VWPM_PROFILE_ACTIVE T WHERE T.FILE_COUNT > 0 AND T.GUID IN (SELECT PROFILE_
Private Sub BBtnItmNotfications_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BBtnItmNotfications.ItemClick
Open_Notifications_Form()
End Sub
Private Sub RibbonControl1_Click(sender As Object, e As EventArgs) Handles RibbonControl1.Click
End Sub
Private Sub BarButtonItem3_ItemClick_2(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem3.ItemClick
End Sub
End Class

View File

@ -9,6 +9,7 @@ Imports DigitalData.GUIs.Common.DocumentResultList
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.EDMI.API.Constants
Imports DigitalData.Modules.EDMI.API.DatabaseWithFallback
Imports DigitalData.Modules.Interfaces
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.ZooFlow.Constants
@ -619,7 +620,7 @@ Public Class frmValidator
Logger.Warn("Error in LookUpLoadSQLData: " & ex.Message)
End Try
ElseIf TypeOf control Is TextEdit Or TypeOf control Is memoedit Then
ElseIf TypeOf control Is TextEdit Or TypeOf control Is MemoEdit Then
Try
Dim firstRow As DataRow = oDTContent.Rows(0)
@ -5616,20 +5617,29 @@ Public Class frmValidator
End Sub
Private Sub barbtnitmExport_ItemClick(sender As Object, e As ItemClickEventArgs) Handles barbtnitmExport.ItemClick
If File.Exists(WMDocPathWindows) Then
If File.Exists(WMDocPathWindows) = False Then
MsgBox("Workflow-Document seems not to exist. Check Your log.", MsgBoxStyle.Exclamation, ADDITIONAL_TITLE)
Exit Sub
End If
Try
Dim oFilenameOnly As String
Dim oExtension As String
Dim oTargetPath As String
Dim oFile2Export As String
If FolderBrowserDialog1.ShowDialog = DialogResult.OK Then
Dim oCount As Integer = 0
Dim oSQLGetFilename As String
If FolderBrowserDialog1.ShowDialog <> DialogResult.OK Then
Exit Sub
End If
oFilenameOnly = Path.GetFileName(WMDocPathWindows)
oExtension = Path.GetExtension(WMDocPathWindows)
Dim oSQLGetFilename As String
oSQLGetFilename = $"DECLARE @Filename Varchar(512) " & vbNewLine &
$"EXEC dbo.PRPM_GETFILENAME_EXPORT {CURRENT_DOC_ID}, 1, @Outputfilename = @Filename OUTPUT;" & vbNewLine &
"SELECT @Filename"
Dim oExportFilename = DatabaseFallback.GetScalarValueECM(oSQLGetFilename)
If Not IsNothing(oExportFilename) Then
If IsDBNull(oExportFilename) Then
@ -5643,8 +5653,13 @@ Public Class frmValidator
If oExtension.EndsWith("pdf") Then
Dim oTempPath = System.IO.Path.GetTempPath()
Dim oTempFullFilename = oTempPath + "\" + oExportFilename & oExtension
'We assume that GdPicture has been correctly installed and unlocked.
NeueDLL
Dim oConverter As New PDFConverter(LOGCONFIG)
If oConverter.ConvertPDFADocumentToPDFDocument(WMDocPathWindows, oTempFullFilename) = False Then
Logger.Warn("File [{0}] could not be converted to plain PDF!", WMDocPathWindows)
End If
oFile2Export = oTempPath
End If
End If
Else
@ -5691,19 +5706,15 @@ Public Class frmValidator
End If
Next
End If
CONFIG.Config.LastExportPath = FolderBrowserDialog1.SelectedPath
CONFIG.Save()
MsgBox($"[{oCount}] file/s successfully exported to target [{FolderBrowserDialog1.SelectedPath}]!", MsgBoxStyle.Information, ADDITIONAL_TITLE)
End If
Catch ex As Exception
Logger.Error(ex)
MsgBox("Could not move file to target: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, ADDITIONAL_TITLE)
End Try
Else
MsgBox("Workflow-Document seems not to exist. Check Your log.", MsgBoxStyle.Exclamation, ADDITIONAL_TITLE)
End If
End Sub