using System.Web.Mvc;
using ZXing;
namespace QR_GEN.Controllers
{
public class GenController : Controller
{
#region Public Methods
///
/// Restituisce un Aztec code dato valore
///
///
///
public ActionResult Aztec(string id, int hSize = 600, int wSize = 600)
{
BarcodeFormat formato = BarcodeFormat.AZTEC;
return utils.getImage2D(ref id, hSize, wSize, formato);
}
///
/// Restituisce un Code128 1D dato valore
///
///
/// mostrare valore + codice (true --> testo sotto)
///
public ActionResult Code128(string id, int hSize = 75, bool showVal = true)
{
BarcodeFormat formato = BarcodeFormat.CODE_128;
return utils.getImage(id, hSize, formato, !showVal);
}
///
/// Restituisce un Code39 1D dato valore
///
///
/// mostrare valore + codice (true --> testo sotto)
///
public ActionResult code39(string id, int hSize = 75, bool showVal = true)
{
BarcodeFormat formato = BarcodeFormat.CODE_39;
return utils.getImage(id, hSize, formato, !showVal);
}
///
/// Restituisce un DataMatrix code dato valore
///
///
///
public ActionResult DataMatrix(string id, int hSize = 300, int wSize = 600)
{
BarcodeFormat formato = BarcodeFormat.DATA_MATRIX;
return utils.getImage2D(ref id, hSize, wSize, formato);
}
public ActionResult Index()
{
return View();
}
///
/// Restituisce un Aztec code dato valore
///
///
///
public ActionResult Pdf417(string id, int hSize = 300, int wSize = 600)
{
BarcodeFormat formato = BarcodeFormat.PDF_417;
return utils.getImage2D(ref id, hSize, wSize, formato);
}
///
/// Restituisce un QR code dato valore
///
///
///
public ActionResult QR(string id, int hSize = 600, int wSize = 600)
{
BarcodeFormat formato = BarcodeFormat.QR_CODE;
return utils.getImage2D(ref id, hSize, wSize, formato);
}
#endregion Public Methods
}
}