FormularManager für SDL, etc.

This commit is contained in:
2024-08-06 16:41:35 +02:00
parent 58deafb5be
commit 8db41361dc
15 changed files with 2907 additions and 557 deletions

View File

@@ -859,6 +859,8 @@ Public Class cFormularManager
Try
Dim f = stamper.AcroFields
f.GenerateAppearances = True
For Each i In list
f.SetField(i.Text, i.Value)
Next
@@ -960,6 +962,51 @@ Public Class cFormularManager
Return ""
End Function
Public Function getPDFFields_Editierbar(da_kategorie As String, da_ordner As String, da_uOrdner1 As String, da_uOrdner2 As String, da_uOrdner3 As String, da_name As String) As List(Of VERAG_PROG_ALLGEMEIN.MyListItem)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.MyListItem)
Try
Dim DS As New cDATENSERVER(da_kategorie, da_ordner, da_uOrdner1, da_uOrdner2, da_uOrdner3, da_name)
If Not DS.hasITEMS Then Return list
Dim path_src = DS.OPEN_SINGLE(False)
If path_src = "" Then Return list
Dim fi As New IO.DirectoryInfo(path_src)
Dim destPath = DATENVERVER_OPTIONS.getTMPPath(fi.Name, fi.Extension, True, False)
Dim pdf As iTextSharp.text.pdf.PdfReader = New iTextSharp.text.pdf.PdfReader(path_src)
Using fw As New FileStream(destPath, FileMode.OpenOrCreate)
Dim stamper = New PdfStamper(pdf, fw)
Try
Dim f = stamper.AcroFields
f.GenerateAppearances = True
For Each r In f.Fields
Dim key = r.Key.ToString
Dim value = IIf(f.GetField(r.Key.ToString) = "", " ", r.Key.ToString)
Dim listItem As VERAG_PROG_ALLGEMEIN.MyListItem
listItem = New VERAG_PROG_ALLGEMEIN.MyListItem(r.Key.ToString, f.GetField(r.Key.ToString))
list.Add(listItem)
Next
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return list
End Function
Public Function fillPDFVorhandenesLokalesPDF_Path(path As String, listToWrite As List(Of cPDFWriteValues), Optional editierbar As Boolean = True, Optional autoDruck As Boolean = False, Optional printerName As String = "", Optional genNewPath As Boolean = True, Optional barcode As List(Of barcodeToPdf) = Nothing) As String
Return fillPDF("", "", "", "", "", "", listToWrite, editierbar, autoDruck, printerName, genNewPath, path, barcode)
End Function