[C#][Print] 傳送未經處理的資料 (Raw Data) 至印表機

摘要:[C#][Print] Raw Data Print

參考:如何傳送到印表機的未經處理的資料,藉由使用 Visual C#.NET 

 

string s = "Hello";

// 讓使用者選擇印表機.
PrintDialog pd = new PrintDialog();
pd.Document = new PrintDocument();
pd.PrinterSettings = new PrinterSettings();
// 一定要設定屬性 UseExDialog = true 才會彈出對話窗
pd.UseEXDialog = true;
if (DialogResult.OK == pd.ShowDialog(this))
{
    // Send a printer-specific to the printer.
    RawPrinterHelper.SendStringToPrinter(pd.PrinterSettings.PrinterName, s);
}

RawPrinterHelper.cs 下載網點