C# 클래스 ThermalDotNet.ThermalPrinter

ESP/POS serial thermal printer library. https://github.com/yukimizake/ThermalDotNet
파일 보기 프로젝트 열기: yukimizake/ThermalDotNet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
PictureLineSleepTimeMs int
WriteLineSleepTimeMs int

공개 메소드들

메소드 설명
BoldOff ( ) : void

Sets bold mode off.

BoldOn ( ) : void

Sets bold mode on.

FeedDots ( byte dotsToFeed ) : void

Prints the contents of the buffer and feeds n dots.

HorizontalLine ( int length ) : void

Prints a horizontal line.

Indent ( byte columns ) : void

Idents the text.

LineFeed ( ) : void

Prints the contents of the buffer and feeds one line.

LineFeed ( byte lines ) : void

Prints the contents of the buffer and feeds n lines.

PrintBarcode ( BarcodeType type, string data ) : void

Prints the barcode data.

PrintImage ( Bitmap image ) : void

Prints the image. The image must be 384px wide.

PrintImage ( string fileName ) : void

Prints the image. The image must be 384px wide.

Reset ( ) : void

Resets the printer.

SetAlignCenter ( ) : void

Centers the text.

SetAlignLeft ( ) : void

Aligns the text to the left.

SetAlignRight ( ) : void

Aligns the text to the right.

SetBarcodeLeftSpace ( byte spacingDots ) : void

Sets the barcode left space.

SetLargeBarcode ( bool large ) : void

Selects large barcode mode.

SetLineSpacing ( byte lineSpacing ) : void

Sets the line spacing.

SetPrintingParameters ( byte maxPrintingDots, byte heatingTime, byte heatingInterval ) : void

Sets the printing parameters.

SetSize ( bool doubleWidth, bool doubleHeight ) : void

Sets the text size.

Sleep ( ) : void

Sets the printer offine.

ThermalPrinter ( SerialPort serialPort ) : System

Initializes a new instance of the ThermalDotNet.ThermalPrinter class.

ThermalPrinter ( SerialPort serialPort, byte maxPrintingDots, byte heatingTime, byte heatingInterval ) : System

Initializes a new instance of the ThermalDotNet.ThermalPrinter class.

ToString ( ) : string

Returns a System.String that represents the current ThermalDotNet.ThermalPrinter.

WakeUp ( ) : void

Sets the printer online.

WhiteOnBlackOff ( ) : void

Sets white on black mode off.

WhiteOnBlackOn ( ) : void

Sets white on black mode on.

WriteLine ( string text ) : void

Prints the line of text.

WriteLine ( string text, PrintingStyle style ) : void

Prints the line of text.

WriteLine ( string text, byte style ) : void

Prints the line of text.

WriteLine_Big ( string text ) : void

Prints the line of text, double size.

WriteLine_Bold ( string text ) : void

Prints the line of text in bold.

WriteLine_Invert ( string text ) : void

Prints the line of text, white on black.

WriteToBuffer ( string text ) : void

Sends the text to the printer buffer. Does not print until a line feed (0x10) is sent.

비공개 메소드들

메소드 설명
_BitClear ( byte originalValue, int bit ) : byte

Return the given value with its n bit cleared.

_BitSet ( byte originalValue, byte bit ) : byte

Return the given value with its n bit set.

_BitTest ( byte valueToTest, int testBit ) : bool

Tests the value of a given bit.

_constructor ( SerialPort serialPort, byte maxPrintingDots, byte heatingTime, byte heatingInterval ) : void
_sendEncoding ( string encoding ) : void
_writeByte ( byte valueToWrite ) : void

메소드 상세

BoldOff() 공개 메소드

Sets bold mode off.
public BoldOff ( ) : void
리턴 void

BoldOn() 공개 메소드

Sets bold mode on.
public BoldOn ( ) : void
리턴 void

FeedDots() 공개 메소드

Prints the contents of the buffer and feeds n dots.
public FeedDots ( byte dotsToFeed ) : void
dotsToFeed byte /// Number of dots to feed. ///
리턴 void

HorizontalLine() 공개 메소드

Prints a horizontal line.
public HorizontalLine ( int length ) : void
length int /// Line length (in characters) (max 32). ///
리턴 void

Indent() 공개 메소드

Idents the text.
public Indent ( byte columns ) : void
columns byte /// Number of columns. ///
리턴 void

LineFeed() 공개 메소드

Prints the contents of the buffer and feeds one line.
public LineFeed ( ) : void
리턴 void

LineFeed() 공개 메소드

Prints the contents of the buffer and feeds n lines.
public LineFeed ( byte lines ) : void
lines byte /// Number of lines to feed. ///
리턴 void

PrintBarcode() 공개 메소드

Prints the barcode data.
public PrintBarcode ( BarcodeType type, string data ) : void
type BarcodeType /// Type of barcode. ///
data string /// Data to print. ///
리턴 void

PrintImage() 공개 메소드

Prints the image. The image must be 384px wide.
public PrintImage ( Bitmap image ) : void
image System.Drawing.Bitmap /// Image to print. ///
리턴 void

PrintImage() 공개 메소드

Prints the image. The image must be 384px wide.
public PrintImage ( string fileName ) : void
fileName string /// Image file path. ///
리턴 void

Reset() 공개 메소드

Resets the printer.
public Reset ( ) : void
리턴 void

SetAlignCenter() 공개 메소드

Centers the text.
public SetAlignCenter ( ) : void
리턴 void

SetAlignLeft() 공개 메소드

Aligns the text to the left.
public SetAlignLeft ( ) : void
리턴 void

SetAlignRight() 공개 메소드

Aligns the text to the right.
public SetAlignRight ( ) : void
리턴 void

SetBarcodeLeftSpace() 공개 메소드

Sets the barcode left space.
public SetBarcodeLeftSpace ( byte spacingDots ) : void
spacingDots byte /// Spacing dots. ///
리턴 void

SetLargeBarcode() 공개 메소드

Selects large barcode mode.
public SetLargeBarcode ( bool large ) : void
large bool /// Large barcode mode. ///
리턴 void

SetLineSpacing() 공개 메소드

Sets the line spacing.
public SetLineSpacing ( byte lineSpacing ) : void
lineSpacing byte /// Line spacing (in dots), default value: 32 dots. ///
리턴 void

SetPrintingParameters() 공개 메소드

Sets the printing parameters.
public SetPrintingParameters ( byte maxPrintingDots, byte heatingTime, byte heatingInterval ) : void
maxPrintingDots byte /// Max printing dots (0-255), unit: (n+1)*8 dots, default: 7 (beceause (7+1)*8 = 64 dots) ///
heatingTime byte /// Heating time (3-255), unit: 10µs, default: 80 (800µs) ///
heatingInterval byte /// Heating interval (0-255), unit: 10µs, default: 2 (20µs) ///
리턴 void

SetSize() 공개 메소드

Sets the text size.
public SetSize ( bool doubleWidth, bool doubleHeight ) : void
doubleWidth bool /// Double width ///
doubleHeight bool /// Double height ///
리턴 void

Sleep() 공개 메소드

Sets the printer offine.
public Sleep ( ) : void
리턴 void

ThermalPrinter() 공개 메소드

Initializes a new instance of the ThermalDotNet.ThermalPrinter class.
public ThermalPrinter ( SerialPort serialPort ) : System
serialPort System.IO.Ports.SerialPort /// Serial port used by printer. ///
리턴 System

ThermalPrinter() 공개 메소드

Initializes a new instance of the ThermalDotNet.ThermalPrinter class.
public ThermalPrinter ( SerialPort serialPort, byte maxPrintingDots, byte heatingTime, byte heatingInterval ) : System
serialPort System.IO.Ports.SerialPort /// Serial port used by printer. ///
maxPrintingDots byte /// Max printing dots (0-255), unit: (n+1)*8 dots, default: 7 ((7+1)*8 = 64 dots) ///
heatingTime byte /// Heating time (3-255), unit: 10µs, default: 80 (800µs) ///
heatingInterval byte /// Heating interval (0-255), unit: 10µs, default: 2 (20µs) ///
리턴 System

ToString() 공개 메소드

Returns a System.String that represents the current ThermalDotNet.ThermalPrinter.
public ToString ( ) : string
리턴 string

WakeUp() 공개 메소드

Sets the printer online.
public WakeUp ( ) : void
리턴 void

WhiteOnBlackOff() 공개 메소드

Sets white on black mode off.
public WhiteOnBlackOff ( ) : void
리턴 void

WhiteOnBlackOn() 공개 메소드

Sets white on black mode on.
public WhiteOnBlackOn ( ) : void
리턴 void

WriteLine() 공개 메소드

Prints the line of text.
public WriteLine ( string text ) : void
text string /// Text to print. ///
리턴 void

WriteLine() 공개 메소드

Prints the line of text.
public WriteLine ( string text, PrintingStyle style ) : void
text string /// Text to print. ///
style PrintingStyle /// Style of the text. ///
리턴 void

WriteLine() 공개 메소드

Prints the line of text.
public WriteLine ( string text, byte style ) : void
text string /// Text to print. ///
style byte /// Style of the text. Can be the sum of PrintingStyle enums. ///
리턴 void

WriteLine_Big() 공개 메소드

Prints the line of text, double size.
public WriteLine_Big ( string text ) : void
text string /// Text to print. ///
리턴 void

WriteLine_Bold() 공개 메소드

Prints the line of text in bold.
public WriteLine_Bold ( string text ) : void
text string /// Text to print. ///
리턴 void

WriteLine_Invert() 공개 메소드

Prints the line of text, white on black.
public WriteLine_Invert ( string text ) : void
text string /// Text to print. ///
리턴 void

WriteToBuffer() 공개 메소드

Sends the text to the printer buffer. Does not print until a line feed (0x10) is sent.
public WriteToBuffer ( string text ) : void
text string /// Text to print. ///
리턴 void

프로퍼티 상세

PictureLineSleepTimeMs 공개적으로 프로퍼티

Delay between two picture lines. (in ms)
public int PictureLineSleepTimeMs
리턴 int

WriteLineSleepTimeMs 공개적으로 프로퍼티

Delay between two text lines. (in ms)
public int WriteLineSleepTimeMs
리턴 int