تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
طباعة الباركود
#3
(28-04-18, 06:17 PM)عبدالله الدوسري كتب : وعليكم السلام

اذا امكن ؟ يرجى ذكر بعض الامور لمعرفت الحل :

١ . كيف تنشئ الباركود.
٢ . كيف تقوم بإرسال الباركود للطابعة.

الأكيد هو اان الخطاء برمجي وليس من الطابعة.

الإحتمال الذي افكر فيه . هو انك تطبع في مكان خارج نطاق الطابعة اذا كانت تطبع اوراق صغيرة.
ممكن تحتاج تطبع في يسار اعلى الصفحة. 

او من الممكن انك تعطي امر الطباعة ولكنك لا ترسم صورة الباركود على الورقة المطبوعة. لذك تعطي امر الطباعة على وثيقة خالية . فتظهر ورقة فاضية.

ارفق الاكواد التي تستخدمها . لمعرفة اين الخطاء

لماذا لا تحاول إستخدام :


Mobility SDK for Windows - Developer Library Software


توجد مكتبات لمساعدة المطورين :
أعتقد يوجد بها أوامر ووظائف كثيرة ستستفيد منها 

للتحميل من هنا :
لا أعرف نوع الطابعة لديك , تحتاج إلى البحث عن الملفات المناسبة لك
https://hsmftp.honeywell.com/





https://www.honeywellaidc.com/products/software/developer-library/mobility-sdk-for-windows

السلام  عليكم  اخي  العزيز  

  اخي العزيز  انا  عندي  الطابعة  من  نوع  PC421 hooneywell  
اما بالنسبة الى  الكود  البرمجي  فهذا الكود  الي انا  قاعد  اتعامل فيه  اخي  الغالي  

كود :
Imports MySql.Data.MySqlClient
Imports System.IO
Imports System.Drawing.Printing
Public Class add_barcode
    Public ToDo As String = "add"
    Public id As Integer

    Private Sub Butcaret_Click(sender As Object, e As EventArgs) Handles Butcaret.Click
        Dim Generator As New MessagingToolkit.Barcode.BarcodeEncoder
        Generator.IncludeLabel = True
        Generator.CustomLabel = Textcod.Text
        Try
            PictureBox1.Image = New Bitmap(Generator.Encode(MessagingToolkit.Barcode.BarcodeFormat.Code11, Textcod.Text))
        Catch ex As Exception

        End Try
    End Sub
    Sub claertext()
        Textcod.Clear()
        Textcat.Clear()
        Textnewcod.Clear()
        Textnewcod.Clear()
        Textnpro.Clear()


    End Sub
    Private Sub Butadd_Click(sender As Object, e As EventArgs) Handles Butadd.Click
        If Textcat.Text = String.Empty Or Textcod.Text = String.Empty Or Textnewcod.Text = String.Empty Or Textnpro.Text = String.Empty Then
            MsgBox("جميع الحقول  مطلوبة يا  صديقي  العزيز", MsgBoxStyle.Information, "تحذير")
            Exit Sub

        End If

        Try

            Dim query As String
            If ToDo = "add" Then
                query = "insert into parcode (name_pro,dic_pro,newcode,pacrcode_ro,imgparcod) values(@name_pro,@dic_pro,@newcode,@pacrcode_ro,@imgparcod) "
            Else
                query = "update parcode set name_pro=@name_pro,dic_pro=@dic_pro,newcode=@newcode,pacrcode_ro=@pacrcode_ro,imgparcod=@imgparcod where id= " & id

            End If
            Dim filesize As UInt32
            Dim mstrem As New System.IO.MemoryStream

            PictureBox1.Image.Save(mstrem, System.Drawing.Imaging.ImageFormat.Jpeg)
            Dim arrimage() As Byte = mstrem.GetBuffer
            filesize = mstrem.Length
            mstrem.Close()

            cmd = New MySqlCommand(query, con)
            cmd.Parameters.Add("@name_pro", MySqlDbType.VarChar, 200).Value = Textnpro.Text
            cmd.Parameters.Add("@dic_pro", MySqlDbType.VarChar, 200).Value = Textcod.Text
            cmd.Parameters.Add("@newcode", MySqlDbType.VarChar, 200).Value = Textnewcod.Text
            cmd.Parameters.Add("@pacrcode_ro", MySqlDbType.VarChar, 200).Value = Textcat.Text
            cmd.Parameters.Add("@imgparcod", MySqlDbType.Blob).Value = arrimage

            con.Open()


            cmd.ExecuteNonQuery()
            claertext()
            MsgBox("تم حفظ البيانات بنجاح شكرا لكم", MsgBoxStyle.Information, "الاضافة")

        Catch ex As Exception
            MsgBox(ex.Message)

        Finally

            con.Close()

        End Try
    End Sub

    Private Sub add_barcode_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim SD As New SaveFileDialog
        SD.Filter = "PNG File|*.png"
        If SD.ShowDialog() = DialogResult.OK Then
            Try
                PictureBox1.Image.Save(SD.FileName, Imaging.ImageFormat.Png)
            Catch ex As Exception

            End Try
        End If
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        print_bar.PictureBox1.ImageLocation = PictureBox1.ImageLocation
    End Sub
    Friend WithEvents prntDoc As New PrintDocument()
    Private Print_Image As Image
    Declare Auto Function BitBlt Lib "GDI32.DLL" ( _
    ByVal hdcDest As IntPtr, _
    ByVal nXDest As Integer, _
    ByVal nYDest As Integer, _
    ByVal nWidth As Integer, _
    ByVal nHeight As Integer, _
    ByVal hdcSrc As IntPtr, _
    ByVal nXSrc As Integer, _
    ByVal nYSrc As Integer, _
    ByVal dwRop As Int32) As Boolean
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        'print picture   
        Dim prnDialog As New PrintDialog()
        'Get a Graphics Object from the form   
        Dim FormG As Graphics = Me.PictureBox1.CreateGraphics
        'Create a bitmap from that graphics   
        Dim i As New Bitmap(Me.Width, Me.Height, FormG)
        'Create a Graphics object in memory from that bitmap   
        Dim memG As Graphics = Graphics.FromImage(i)
        'get the IntPtr's of the graphics   
        Dim HDC1 As IntPtr = FormG.GetHdc
        Dim HDC2 As IntPtr = memG.GetHdc
        'get the picture   
        BitBlt(HDC2, 0, 0, Me.PictureBox1.Width, Me.PictureBox1.Height, HDC1, 0, 0, 13369376)
        'Clone the bitmap so we can dispose this one   
        Me.Print_Image = i.Clone()
        'Clean Up   
        FormG.ReleaseHdc(HDC1)
        memG.ReleaseHdc(HDC2)
        FormG.Dispose()
        memG.Dispose()
        i.Dispose()

        prnDialog.Document = prntDoc

        ' Optional Dialog:   
        Dim r As DialogResult = prnDialog.ShowDialog
        If r = DialogResult.OK Then
            prntDoc.Print()
        End If
    End Sub
    Private Sub prntDoc_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles prntDoc.PrintPage
        e.Graphics.DrawImage(Print_Image, 0, 0)
    End Sub
End Class
هذا الكود بالكامل  اخي  العزيز بانتظار  ردك الكريم  وفقك الله
الرد }}}
تم الشكر بواسطة: asemshahen5


الردود في هذا الموضوع
طباعة الباركود - بواسطة فراس الغزي - 28-04-18, 11:59 AM
RE: طباعة الباركود - بواسطة فراس الغزي - 28-04-18, 09:29 PM
RE: طباعة الباركود - بواسطة sendbad100 - 29-04-18, 03:28 AM
RE: طباعة الباركود - بواسطة فراس الغزي - 28-04-18, 11:59 PM
RE: طباعة الباركود - بواسطة محمد اسماعيل - 29-04-18, 12:05 AM
RE: طباعة الباركود - بواسطة فراس الغزي - 29-04-18, 12:38 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [سؤال] سؤال ترددت قبل نشرة:طابعة الباركود لماذا تطبع أكثر من ليبل فارغ قبل السليم dr.programming 1 515 20-04-25, 09:26 PM
آخر رد: Kamil
  [سؤال] اريد طباعة تقرير ريبورت فيو مباشرة فور عرض التقرير mh66 1 565 22-03-25, 09:59 AM
آخر رد: mh66
  طريقة طباعة ملف pdf بقاعدة بيانات sql heem1986 0 533 25-02-25, 09:31 AM
آخر رد: heem1986
  كيف ايجاد أعلى رقم بعد علامة محددة.لحقل الباركود new_programer 6 476 20-01-25, 02:11 AM
آخر رد: new_programer
  طباعة تقرير كرستال DOX.1 7 2,270 14-10-24, 06:59 AM
آخر رد: am000er
  طباعة تقرير بطول وعرض معين (التقرير عبارة عن سطر) atefkhalf2004 7 644 15-07-24, 01:53 AM
آخر رد: atefkhalf2004
  طباعة report viewer دون فتح نافذة الطابعات atefkhalf2004 6 698 18-06-24, 02:35 PM
آخر رد: atefkhalf2004
  الباركود بيطلع فارغ عند الطباعة new_programer 2 565 29-05-24, 03:59 AM
آخر رد: new_programer
  اريد طباعة الباركود من غير ظهور نافذة المعاينة new_programer 1 535 23-05-24, 03:55 AM
آخر رد: new_programer
  [C#.NET] طباعة بيانات داتا جرد فيو h2551996 0 400 25-02-24, 02:31 PM
آخر رد: h2551996

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم