using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Printing;
using System.Data;
using System.Windows.Forms;
namespace WeightSystem
{
public class cutePrinter2
{
private DataGridView dataGridView1;
private PrintDocument printDocument;
private PageSetupDialog pageSetupDialog;
private PrintPreviewDialog printPreviewDialog;
private string title = "";
int currentPageIndex = 0;
int rowCount = 0;
int pageCount = 0;
int titleSize = 20;
bool isCustomHeader = false;
Brush alertBrush = new SolidBrush(Color.Red);
string[] header = null; // 如果自定義就填入字符串,如果需要斜線分隔,就用表示,例如:個數#名字 其中#為splitChar
string[] uplineHeader = null; // 上行文字數組
int[] upLineHeaderIndex = null; // 上行的文字index,如果沒有上行就設為-1;
public bool isEveryPagePrintTitle = true; // 是否每一頁都要打印標題。
public int headerHeight = 30; // 標題高度。
public int topMargin = 30; // 頂邊距
public int