Riaggiunto GMW_data
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Printing;
|
||||
using System.Windows.Forms;
|
||||
using SteamWare;
|
||||
using GMW_data;
|
||||
using System.Drawing;
|
||||
|
||||
|
||||
namespace GMW_data
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe che si occupa di stampare etichette barcode via printer remota
|
||||
/// </summary>
|
||||
public class bCodePrinter
|
||||
{
|
||||
/// <summary>
|
||||
/// funzione di stampa...
|
||||
/// </summary>
|
||||
public void Print(string printerName, PaperSize pSize, string testo, string bCode, float EmSize )
|
||||
{
|
||||
text2print = testo;
|
||||
bCode2print = bCode;
|
||||
baseEmSize = EmSize;
|
||||
PrintDocument label = new PrintDocument();
|
||||
label.DefaultPageSettings.PaperSize = pSize;
|
||||
label.PrinterSettings.PrinterName = printerName;
|
||||
label.PrinterSettings.DefaultPageSettings.PaperSize = pSize;
|
||||
label.PrintPage += new PrintPageEventHandler(PrintPage);
|
||||
label.Print();
|
||||
}
|
||||
public string text2print { get; set; }
|
||||
public string bCode2print { get; set; }
|
||||
public float baseEmSize { get; set; }
|
||||
private void PrintPage(object sender, PrintPageEventArgs e)
|
||||
{
|
||||
SolidBrush brush = new SolidBrush(Color.Black);
|
||||
Font arial = new Font("Arial", baseEmSize, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
Font threeOfNine = new Font("Free 3 of 9 Extended", baseEmSize* 3, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
|
||||
e.Graphics.DrawString(text2print, arial, brush, 0, 5);
|
||||
e.Graphics.DrawString("*" + bCode2print + "*", threeOfNine, brush, 0, Convert.ToInt32(10 + baseEmSize));
|
||||
e.Graphics.DrawString("*" + bCode2print + "*", threeOfNine, brush, 0, Convert.ToInt32(10 + baseEmSize * 2));
|
||||
e.Graphics.DrawString("*" + bCode2print + "*", threeOfNine, brush, 0, Convert.ToInt32(10 + baseEmSize * 3));
|
||||
e.Graphics.DrawString("*" + bCode2print + "*", threeOfNine, brush, 0, Convert.ToInt32(10 + baseEmSize * 4));
|
||||
e.Graphics.DrawString("*" + bCode2print + "*", threeOfNine, brush, 0, Convert.ToInt32(10 + baseEmSize * 5));
|
||||
e.Graphics.DrawString("*" + bCode2print + "*", threeOfNine, brush, 0, Convert.ToInt32(10 + baseEmSize * 6));
|
||||
}
|
||||
/// <summary>
|
||||
/// oggetto protected
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
protected bCodePrinter()
|
||||
{
|
||||
}
|
||||
/// <summary>
|
||||
/// singleton pubblico
|
||||
/// </summary>
|
||||
public static bCodePrinter man = new bCodePrinter();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user