IDS-Stationen, IDS-Preis, cDatenserver, etc.

This commit is contained in:
2025-10-28 10:46:52 +01:00
parent 8a8919e44c
commit 51d41b979e
8 changed files with 1152 additions and 25 deletions

View File

@@ -1394,30 +1394,21 @@ Public Class cFormularManager
For Each pdfPath As String In PDFFile
Dim doc As New Spire.Pdf.PdfDocument(pdfPath)
Using doc As New Spire.Pdf.PdfDocument(pdfPath)
'Versuche, die Seitengröße zu überprüfen
'-----------------------------------------
If doc.Pages.Count = 0 Then
' Leeres Dokument, überspringen
Continue For
End If
Dim pageSize = doc.Pages(0).Size
If pageSize.Width <= 0 OrElse pageSize.Height <= 0 Then
' Ungültige Seitengröße, überspringen
Continue For
End If
'-----------------------------------------
If doc.Pages.Count = 0 Then Continue For
Dim size = doc.Pages(0).Size
If size.Width <= 0 OrElse size.Height <= 0 Then Continue For
' --- Druckeinstellungen ---
doc.PrintSettings.PrinterName = printerName
doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.ActualSize, False)
doc.PrintSettings.Landscape = True
doc.PrintSettings.PaperSize = New System.Drawing.Printing.PaperSize("A4", 827, 1169)
doc.Print()
doc.PageSettings.Size = Spire.Pdf.PdfPageSize.A4
doc.PageSettings.Orientation = Spire.Pdf.PdfPageOrientation.Landscape
doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.FitSize, True)
doc.PrintSettings.PrinterName = printerName
doc.Print()
Next
End Using
Next
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)