update 20250129
This commit is contained in:
@@ -45,14 +45,35 @@ Public Class vbarcodes
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function ScaleImage(ByVal image As Image, ByVal height As Integer) As Image
|
||||
Dim ratio As Double = height / image.Height
|
||||
Dim newWidth = CInt(image.Width * ratio)
|
||||
Dim newHeight = CInt(image.Height * ratio)
|
||||
Dim newImage As Bitmap = New Bitmap(newWidth, newHeight)
|
||||
Using g As Graphics = Graphics.FromImage(newImage)
|
||||
g.DrawImage(image, 0, 0, newWidth, newHeight)
|
||||
End Using
|
||||
image.Dispose()
|
||||
Return newImage
|
||||
End Function
|
||||
|
||||
|
||||
Dim BarcodeBeschriftung As String = ""
|
||||
Dim BarcodeContent As String = ""
|
||||
Dim Kantenlaenge As String = ""
|
||||
Dim BarcodeFormatn As String = ""
|
||||
|
||||
Dim barcodeImage2of5 As System.Drawing.Image
|
||||
Private Sub ins_Barcode()
|
||||
Dim Barcode2of5 As New BarcodeLib.clsBarI25()
|
||||
barcodeImage2of5 = Barcode2of5.GetBarI25(Color.Black, Color.White, docdata.Dokumentid.Substring(6, 16), "Bar 25i c HR", 36, 350, 50, " U", "Futur Book", 8, 0)
|
||||
barcodeImage2of5.Save(Temppath + "a_" + docdata.Dokumentid + ".png", System.Drawing.Imaging.ImageFormat.Png)
|
||||
'barcodeImage2of5 = Barcode.Get_LinerBarcode(Barcoded.Symbology.I2of5, docdata.Dokumentid.Substring(6, 16), docdata.Dokumentid.Substring(6, 16) + docdata.barcode_zusatz, docdata.barcode_textposition, docdata.Zusatz_Font, Convert.ToInt32(docdata.Zusatz_FontSize), 0)
|
||||
'barcodeImage2of5 = ScaleImage(barcodeImage2of5,
|
||||
' 30)
|
||||
'barcodeImage2of5.Save(Temppath + "a_" + docdata.Dokumentid + ".png", System.Drawing.Imaging.ImageFormat.Png)
|
||||
|
||||
BarcodeFormatn = docdata.barcode_formatn
|
||||
|
||||
BarcodeFormatn =
|
||||
BarcodeBeschriftung = docdata.barcode_text
|
||||
Kantenlaenge = docdata.barcode_kantenlaenge
|
||||
BarcodeContent = docdata.barcode_content
|
||||
@@ -162,6 +183,15 @@ Public Class vbarcodes
|
||||
Form.Select()
|
||||
Form = objWord.Selection.HeaderFooter.Shapes.Item(Textboxes(Textboxesi))
|
||||
Form.Select()
|
||||
|
||||
'objWord.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphLeft
|
||||
'objWord.Selection.HomeKey(Unit:=Microsoft.Office.Interop.Word.WdUnits.wdLine, Extend:=Microsoft.Office.Interop.Word.WdMovementType.wdExtend)
|
||||
'objWord.Selection.Delete(Unit:=Microsoft.Office.Interop.Word.WdUnits.wdCharacter, Count:=1)
|
||||
'objWord.Selection.InlineShapes.AddPicture(Temppath + "\a_" + docdata.Dokumentid.ToString + ".png", LinkToFile:=False, SaveWithDocument:=True)
|
||||
'Form = Nothing
|
||||
'Return
|
||||
|
||||
|
||||
If docdata.barcode_horizontal = False Then
|
||||
objWord.ActiveDocument.Tables.Add(Range:=objWord.Selection.Range, NumRows:=1, NumColumns:=1)
|
||||
With objWord.Selection.Tables.Item(1)
|
||||
@@ -183,6 +213,9 @@ Public Class vbarcodes
|
||||
id = docdata.Dokumentid
|
||||
''Barcode-Generierung
|
||||
|
||||
|
||||
|
||||
|
||||
s = Bar25I(Microsoft.VisualBasic.Right(Right(id, Len(id) - 6), 16))
|
||||
objWord.Selection.TypeText(Text:=s)
|
||||
objWord.Selection.HomeKey(Unit:=Microsoft.Office.Interop.Word.WdUnits.wdLine, Extend:=Microsoft.Office.Interop.Word.WdMovementType.wdExtend)
|
||||
|
||||
Reference in New Issue
Block a user