01.
02.
03.
04.
using
(Image logo = Image.FromFile(@
"C:\temp\AWCoupon.jpg"
))
05.
{
06.
e.Graphics.DrawImage(logo,
new
Point(0, 0));
07.
}
08.
09.
10.
using
(Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional barcode =
new
Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional())
11.
{
12.
13.
barcode.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128;
14.
15.
barcode.BarcodeUnit = Neodynamic.WinControls.BarcodeProfessional.BarcodeUnit.Inch;
16.
barcode.BarWidth = 0.015;
17.
barcode.BarHeight = 0.75;
18.
19.
barcode.Code = Guid.NewGuid().ToString().ToUpper().Substring(0, 16);
20.
21.
barcode.CodeAlignment = Neodynamic.WinControls.BarcodeProfessional.Alignment.BelowJustify;
22.
23.
using
(Font fnt =
new
Font(
"Courier New"
, 10f))
24.
{
25.
barcode.Font = fnt;
26.
}
27.
28.
29.
barcode.DrawOnCanvas(e.Graphics,
new
PointF(0.1f, 1.5f));
30.
}
31.
32.
33.
using
(Font fnt1 =
new
Font(
"Arial"
, 12f, FontStyle.Bold))
34.
{
35.
using
(Font fnt2 =
new
Font(
"Arial"
, 8f, FontStyle.Regular))
36.
{
37.
e.Graphics.DrawString(
"RESELLER INTRUCTIONS"
, fnt1, Brushes.Black,
new
PointF(10f, 270f));
38.
e.Graphics.DrawString(
"Use Item -% Off for the 15%. Scan coupon barcode or enter coupon code. Collect coupon with purchase as coupon may only be redeemed once per customer."
, fnt2, Brushes.Black,
new
RectangleF(
new
PointF(10f, 290f),
new
SizeF(570f, 50f)));
39.
40.
e.Graphics.DrawString(
"COUPON OFFER DETAILS"
, fnt1, Brushes.Black,
new
PointF(10f, 350f));
41.
e.Graphics.DrawString(
"This coupon can be redeemed once at any Adventure Works Cycles retail store."
+ Environment.NewLine +
"This coupon is valid from May 21, 2009 to Jun 21, 2009."
, fnt2, Brushes.Black,
new
RectangleF(
new
PointF(10f, 370f),
new
SizeF(570f, 50f)));
42.
}
43.
}