frnHauptfenster, etc.

This commit is contained in:
2025-11-07 15:11:17 +01:00
parent 99ddb21768
commit f60ae204db
5 changed files with 132 additions and 94 deletions

View File

@@ -205,15 +205,23 @@ Public Class frmSendungAnhangImport
PdfViewer.Visible = (loc <> "")
If loc <> "" Then
Dim data = File.ReadAllBytes(loc)
Dim pdfStream = New MemoryStream(data)
PdfViewer.LoadFromStream(pdfStream)
pdfStream.Close()
Dim header As String = System.Text.Encoding.ASCII.GetString(data, 0, Math.Min(4, data.Length))
If header = "%PDF" Then
Dim pdfStream = New MemoryStream(data)
PdfViewer.LoadFromStream(pdfStream)
pdfStream.Close()
End If
End If
'NOT WORKING
'PdfViewer.LoadFromFile(loc) NOT WORKING
End If
'NOT WORKING
'PdfViewer.LoadFromFile(loc) NOT WORKING
End If
ElseIf typ = "BILD" Or typ = ".jpg" Then
PdfViewer.Visible = False
WebBrowser.Visible = (loc <> "")