|
|
@@ -40,6 +40,11 @@ namespace Dongke.WinForm.Controls.InvoiceLayout
|
|
|
private DataTable _printGridData = null;
|
|
|
|
|
|
private PrintDocument _printDocument = new PrintDocument();
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 0:正常,1:旋转180,
|
|
|
+ /// </summary>
|
|
|
+ private int _printDirectionKind = 0;
|
|
|
#endregion
|
|
|
|
|
|
#region 构造函数
|
|
|
@@ -107,7 +112,7 @@ namespace Dongke.WinForm.Controls.InvoiceLayout
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void Print(string printerName, short copies, byte[] layout, DataRow data, DataTable detail)
|
|
|
+ public static void Print(string printerName, short copies, byte[] layout, DataRow data, DataTable detail, int printDirectionKind = 0)
|
|
|
{
|
|
|
//Logger.Debug("打印开始0");
|
|
|
if (layout == null || layout.Length == 0)
|
|
|
@@ -126,6 +131,9 @@ namespace Dongke.WinForm.Controls.InvoiceLayout
|
|
|
{
|
|
|
//Logger.Debug("打印开始1");
|
|
|
InvoiceLayoutPrinter printer = new InvoiceLayoutPrinter();
|
|
|
+
|
|
|
+ printer._printDirectionKind = printDirectionKind;
|
|
|
+
|
|
|
printer.LayoutItems = new List<LayoutItem>();
|
|
|
printer.ReadLayout(layout);
|
|
|
printer._printData = data;
|
|
|
@@ -267,8 +275,18 @@ namespace Dongke.WinForm.Controls.InvoiceLayout
|
|
|
|
|
|
private bool DrawPage(Graphics graphics)
|
|
|
{
|
|
|
- //try
|
|
|
- {
|
|
|
+ if (_printDirectionKind == 1)
|
|
|
+ {
|
|
|
+ //System.Drawing.Drawing2D.Matrix mtxSave = e.Graphics.Transform;
|
|
|
+ //Matrix mtxRotate = layoutGraphics.Transform;
|
|
|
+ //mtxRotate.Rotate(180);
|
|
|
+ //e.Graphics.Transform.Rotate(180);
|
|
|
+ graphics.TranslateTransform(this.Property.PaperWidth, this.Property.PaperHeight);
|
|
|
+ graphics.RotateTransform(180);
|
|
|
+ }
|
|
|
+
|
|
|
+ //try
|
|
|
+ {
|
|
|
// 背景打印
|
|
|
if (this.Property.PrintBackground)
|
|
|
{
|