fiskaluebersicht, etc.
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
Imports System.Text.RegularExpressions
|
Imports System.Text.RegularExpressions
|
||||||
Imports VERAG_PROG_ALLGEMEIN
|
Imports VERAG_PROG_ALLGEMEIN
|
||||||
|
|
||||||
|
|
||||||
Public Class usrcntlFiskaluebersicht
|
Public Class usrcntlFiskaluebersicht
|
||||||
|
|
||||||
Public kdNr As Integer = -1
|
Public kdNr As Integer = -1
|
||||||
@@ -362,8 +363,33 @@ Public Class usrcntlFiskaluebersicht
|
|||||||
If BA IsNot Nothing Then
|
If BA IsNot Nothing Then
|
||||||
If BA.ba_datenarchivId > 0 Then files.Add(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(BA.ba_datenarchivId))
|
If BA.ba_datenarchivId > 0 Then files.Add(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(BA.ba_datenarchivId))
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
For Each r As DataGridViewRow In dgvUnterlagen.Rows
|
For Each r As DataGridViewRow In dgvUnterlagen.Rows
|
||||||
files.Add(VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(r.Cells("fka_docId").Value))
|
|
||||||
|
Dim Path = VERAG_PROG_ALLGEMEIN.cDATENSERVER.GET_PDFPath_BY_DocID(r.Cells("fka_docId").Value)
|
||||||
|
|
||||||
|
Dim extension As String = System.IO.Path.GetExtension(Path).ToLowerInvariant()
|
||||||
|
|
||||||
|
Select Case extension
|
||||||
|
|
||||||
|
Case ".pdf"
|
||||||
|
|
||||||
|
files.Add(Path)
|
||||||
|
|
||||||
|
Case ".png", ".jpg", ".jpeg", ".bmp", ".gif", ".tif", ".tiff"
|
||||||
|
|
||||||
|
Dim PathTemp As String = VERAG_PROG_ALLGEMEIN.cFormularManager.convertPictureToPDF(Path)
|
||||||
|
|
||||||
|
If Not String.IsNullOrEmpty(PathTemp) Then
|
||||||
|
files.Add(PathTemp)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
VERAG_PROG_ALLGEMEIN.cFormularManager.mergePDFs(files, outputFile)
|
VERAG_PROG_ALLGEMEIN.cFormularManager.mergePDFs(files, outputFile)
|
||||||
|
|
||||||
@@ -1065,7 +1091,7 @@ Public Class usrcntlFiskaluebersicht
|
|||||||
|
|
||||||
|
|
||||||
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "FISKALKUNDENANHAENGE", fk.FK_Datum, "", "", ArtId, kdNr)
|
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("DOKUMENTE", "FISKALKUNDENANHAENGE", fk.FK_Datum, "", "", ArtId, kdNr)
|
||||||
If DS.uploadDataToDATENSERVERFileDialog(, ".pdf", , "PDF") Then
|
If DS.uploadDataToDATENSERVERFileDialog() <> "" Then
|
||||||
|
|
||||||
Dim ANH = New VERAG_PROG_ALLGEMEIN.cFiskalkundenAnhaenge()
|
Dim ANH = New VERAG_PROG_ALLGEMEIN.cFiskalkundenAnhaenge()
|
||||||
ANH.fka_Art = ArtId
|
ANH.fka_Art = ArtId
|
||||||
|
|||||||
@@ -482,7 +482,7 @@ Public Class cSMS
|
|||||||
If Originator.Length > 11 Then Originator = Originator.Substring(0, 11)
|
If Originator.Length > 11 Then Originator = Originator.Substring(0, 11)
|
||||||
|
|
||||||
If Message.Contains(vbLf) Then
|
If Message.Contains(vbLf) Then
|
||||||
Message = Message.Replace(vbLf, " ")
|
Message = Message.Replace(vbLf, ", ")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Dim json As New Chilkat.JsonObject
|
Dim json As New Chilkat.JsonObject
|
||||||
|
|||||||
@@ -1274,6 +1274,48 @@ Public Class cFormularManager
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Shared Function convertPictureToPDF(path As String) As String
|
||||||
|
|
||||||
|
If Not File.Exists(path) Then
|
||||||
|
Throw New FileNotFoundException("Picture not found.", path)
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim outputPath As String = getTMPPath_PDF()
|
||||||
|
|
||||||
|
Dim pdfImage As Spire.Pdf.Graphics.PdfImage = pdfImage.FromFile(path)
|
||||||
|
|
||||||
|
Dim doc As New Spire.Pdf.PdfDocument()
|
||||||
|
|
||||||
|
Try
|
||||||
|
Dim page As PdfPageBase = doc.Pages.Add()
|
||||||
|
|
||||||
|
Dim pageWidth As Single = page.ActualSize.Width
|
||||||
|
Dim pageHeight As Single = page.ActualSize.Height
|
||||||
|
|
||||||
|
'Seitenverhältnis beibehalten
|
||||||
|
Dim scaleX As Single = pageWidth / pdfImage.Width
|
||||||
|
Dim scaleY As Single = pageHeight / pdfImage.Height
|
||||||
|
Dim scale As Single = Math.Min(scaleX, scaleY)
|
||||||
|
|
||||||
|
Dim imageWidth As Single = pdfImage.Width * scale
|
||||||
|
Dim imageHeight As Single = pdfImage.Height * scale
|
||||||
|
|
||||||
|
'Bild zentrieren
|
||||||
|
Dim x As Single = (pageWidth - imageWidth) / 2
|
||||||
|
Dim y As Single = (pageHeight - imageHeight) / 2
|
||||||
|
|
||||||
|
page.Canvas.DrawImage(pdfImage, 0, 0)
|
||||||
|
|
||||||
|
doc.SaveToFile(outputPath)
|
||||||
|
|
||||||
|
Finally
|
||||||
|
doc.Close()
|
||||||
|
End Try
|
||||||
|
|
||||||
|
|
||||||
|
Return outputPath
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1535,6 +1577,7 @@ Public Class cFormularManager
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Public Shared Function getPDFViaSpirePDF_FromURL(URL As String, Optional targetPath As String = "") As String
|
Public Shared Function getPDFViaSpirePDF_FromURL(URL As String, Optional targetPath As String = "") As String
|
||||||
Try
|
Try
|
||||||
If targetPath = "" Then targetPath = getTMPPath_PDF()
|
If targetPath = "" Then targetPath = getTMPPath_PDF()
|
||||||
@@ -2614,7 +2657,7 @@ Public Class DATENVERVER_OPTIONS
|
|||||||
xmp.SetStructField(pdfaExt, "schemas[1]", pdfaSchema, "namespaceURI", fxNs)
|
xmp.SetStructField(pdfaExt, "schemas[1]", pdfaSchema, "namespaceURI", fxNs)
|
||||||
xmp.SetStructField(pdfaExt, "schemas[1]", pdfaSchema, "prefix", "fx")
|
xmp.SetStructField(pdfaExt, "schemas[1]", pdfaSchema, "prefix", "fx")
|
||||||
|
|
||||||
' 🔥 property MUSS rdf:Seq sein!
|
' property MUSS rdf:Seq sein!
|
||||||
xmp.SetStructField(
|
xmp.SetStructField(
|
||||||
pdfaExt,
|
pdfaExt,
|
||||||
"schemas[1]",
|
"schemas[1]",
|
||||||
@@ -2632,7 +2675,7 @@ Public Class DATENVERVER_OPTIONS
|
|||||||
|
|
||||||
Dim arrayPath = "schemas[1]/pdfaSchema:property"
|
Dim arrayPath = "schemas[1]/pdfaSchema:property"
|
||||||
|
|
||||||
' 🔥 Item in rdf:Seq hinzufügen
|
' Item in rdf:Seq hinzufügen
|
||||||
xmp.AppendArrayItem(
|
xmp.AppendArrayItem(
|
||||||
pdfaExt,
|
pdfaExt,
|
||||||
arrayPath,
|
arrayPath,
|
||||||
|
|||||||
Reference in New Issue
Block a user