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
{
///
/// Classe che si occupa di stampare etichette barcode via printer remota
///
public class bCodePrinter
{
///
/// funzione di stampa...
///
public void Print(string printerName, PaperSize pSize, string testo)
{
tex2print = testo;
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 tex2print { get; set; }
private void PrintPage(object sender, PrintPageEventArgs e)
{
SolidBrush brush = new SolidBrush(Color.Black);
Font threeOfNine = new Font("Free 3 of 9 Extended", 40, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
e.Graphics.DrawString("*" + tex2print + "*", threeOfNine, brush, 20, 20);
}
///
/// oggetto protected
///
///
protected bCodePrinter()
{
#if false
logLevel = memLayer.ML.confReadInt("_logLevel");
#endif
}
///
/// singleton pubblico
///
public static bCodePrinter man = new bCodePrinter();
}
}