تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] مشكلة الصفحات الجديدة عند الطباعة
#5
(02-08-19, 06:55 AM)asemshahen5 كتب : مش عارف اظبط فكرتك مع طباعة الصور عندي  ياريت تعديل بسيط علي اكوادي وخصوصا ان المتغير نصوص بفكرتك ولدي صور

مفيش فرق :

PHP كود :
e.Graphics.DrawImage(PictureBox1.Image301518060

PHP كود :
e.Graphics.DrawImage(PictureBox1.Image2301518060

بدال :

PHP كود :
e.Graphics.DrawString(String.Format("Page {0}, Record {1}: {2}",
 
                                               pageNumber,
 
                                               overallRecordIndex,
 
                                               lines(overallRecordIndex)),
 
                                 fn,
 
                                 Brushes.Black,
 
                                 10,
 
                                 yOffset
و الصفحة طوليا تملئ بـ 18 باركود و الباقي اصبح سهلا .

حاولت بالطريقة دية ولم احل المشكلة

انا ضيفت السعر اسفل الباركود ويظهر في اعلي الصفحة فقط  والباركود لا ينتقل لصفحة الجديدة وينسخ القديم لصفحة الجديدة


كود :
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
       On Error Resume Next
       barcodes.Clear()
       For Each r As DataGridViewRow In GetCheckedRows(DataGridView1, 0)
           With r
               Dim im As Image = Code128Rendering.MakeBarcodeImage(.Cells("Price").Value.ToString, .Cells("Num").Value.ToString, .Cells("Code").Value.ToString, .Cells("Name").Value.ToString, 2, True)
               '.Cells("BarCode").Value = im
               barcodes.Add(im)
               lines.Add(.Cells("Price").Value.ToString)
           End With
       Next
       overallRecordIndex = 0
       pageNumber = 1
   End Sub
   Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
       On Error Resume Next
       Dim pageRecordIndex = 0
       Dim yOffset = 10
       'كو تغيير الخط'
       Dim fn As New System.Drawing.Font("Cambria", 10.0!, System.Drawing.FontStyle.Bold)
       'تحديد عدد السجلات في الصفحة'

       Do While pageRecordIndex < 4 AndAlso overallRecordIndex < barcodes.Count AndAlso overallRecordIndex < lines.Count
           e.Graphics.DrawString(String.Format("Page {0}, Record {1}: {2}",
                                             pageNumber,
                                             overallRecordIndex,
                                             lines(overallRecordIndex)),
                               fn,
                               Brushes.Black,
                               100,
                               yOffset + 20)
           For Each bc As Image In barcodes
               e.Graphics.DrawImage(bc, 100, yOffset)
               yOffset += 100
           Next
           overallRecordIndex += 1
           pageRecordIndex += 1
       Loop
       e.HasMorePages = (overallRecordIndex < barcodes.Count)
       If e.HasMorePages Then
           pageNumber += 1
       End If
   End Sub
الرد }}}
تم الشكر بواسطة: حريف برمجة


الردود في هذا الموضوع
RE: مشكلة الصفحات الجديدة عند الطباعة - بواسطة محمد اسماعيل - 02-08-19, 11:21 AM


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


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