Skip to content

Techployee/direct-print

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

pipeline

Send raw data directly to a printer.

Usage

Creating a printer object.

Local Printer

Printer printer = new Printer("HP Color LaserJet 1600");

Network Printer

Printer printer = new Printer("\\192.168.1.200\Brother MFC-7362N Printer");

Print Job

A Print job can be created with three different constructors.

PrintJob(JobName, DataType, string)
PrintJob(JobName, DataType, byte[])
PrintJob(JobName, DataType, FileInfo)

Three data types:

  • DataType.RAW
  • DataType.Text
  • DataType.XPS_PASS

Printing

Printing a string.

printer.Print(new PrintJob("StringTest", DataType.RAW, "Hello World!"));

Printing a byte array.

printer.Print(new PrintJob("ByteTest", DataType.RAW, Encoding.ASCII.GetBytes("Hello World!")));

Printing a file.

printer.Print(new PrintJob("FileTest", DataType.RAW, "path\to\file.txt");

About

Send raw data directly to a printer.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages