static string IsbnToEan13(string isbn) { isbn = NormalizeIsbn(isbn); string code = "978" + isbn.Substring(0, 9); code += (char)('0' + Ean13.CalculateChecksum(code)); return(code); }
static void Main(string[] args) { /* * //string isbn = "0-7356-1917-4"; * string isbn = "90 261 1455 9"; * * bool valid = CheckIsbn(isbn); * if (!valid) * throw new Exception(); * * string code = IsbnToEan13(isbn); * * Ean13 barcode = new Ean13(code, "ISBN " + isbn); */ //Ean13 barcode = new Ean13("5028421973326", null); Ean13 barcode = new Ean13("4009900409537", null); barcode.Paint().Save("c:\\temp\\test.png", ImageFormat.Png); }