source code ini di gabungkan dengan metode rawprinter yang pernah aku bahas di posting yang terdahulu. langsung aja ya ni sourcenya
Call StartPagePrinter(lhPrinter)
' Sending raw data to the printer
sWrittenData = Chr(&H1B) + Chr(&H1D) + Chr(&H61) + Chr(&H1) 'Center Alignment - Refer to Pg. 3-29
sWrittenData = sWrittenData + Chr(&H5B) + "If loaded.. Logo1 goes here" + Chr(&H5D) + vbCrLf
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H1C) + Chr(&H70) + Chr(&H1) + Chr(&H0) + vbCrLf 'Stored Logo Printing - Refer to Pg. 3-38
sWrittenData = sWrittenData + "Star Clothing Boutique" + vbCrLf
sWrittenData = sWrittenData + "1150 King Georges Post Rd." + vbCrLf
sWrittenData = sWrittenData + "Edison, NJ 08837" + vbCrLf
sWrittenData = sWrittenData + vbCrLf
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H1D) + Chr(&H61) + Chr(&H0) 'Left Alignment - Refer to Pg. 3-29
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H44) + Chr(&H2) + Chr(&H10) + Chr(&H22) + Chr(&H0) 'Setting Horizontal Tab - Pg. 3-27
sWrittenData = sWrittenData + "Date: 12/31/2008 " + Chr(&H9) + " Time: 9:10 PM" 'Moving Horizontal Tab - Pg. 3-26
sWrittenData = sWrittenData + "------------------------------------------------" + vbCrLf + vbCrLf
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H45) 'Select Emphasized Printing - Pg. 3-14
sWrittenData = sWrittenData + "SALE" + vbCrLf
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H46) 'Cencel Emphasized Printing - Pg. 3-14
sWrittenData = sWrittenData + "SKU " + Chr(&H9) + " Description " + Chr(&H9) + " Total" + vbCrLf
sWrittenData = sWrittenData + "300678566 " + Chr(&H9) + " PLAN T-SHIRT" + Chr(&H9) + " 10.99" + vbCrLf
sWrittenData = sWrittenData + "300692003 " + Chr(&H9) + " BLACK DENIM" + Chr(&H9) + " 29.99" + vbCrLf
sWrittenData = sWrittenData + "300651148 " + Chr(&H9) + " BLUE DENIM" + Chr(&H9) + " 29.99" + vbCrLf
sWrittenData = sWrittenData + "300642980 " + Chr(&H9) + " STRIPE DRESS" + Chr(&H9) + " 49.99" + vbCrLf
sWrittenData = sWrittenData + "300638471 " + Chr(&H9) + " BLACK BOOT" + Chr(&H9) + " 35.99" + vbCrLf
sWrittenData = sWrittenData + vbCrLf
sWrittenData = sWrittenData + "Subtotal " + Chr(&H9) + "" + Chr(&H9) + " 156.95" + vbCrLf
sWrittenData = sWrittenData + "Tax " + Chr(&H9) + "" + Chr(&H9) + " 00.00" + vbCrLf
sWrittenData = sWrittenData + "------------------------------------------------" + vbCrLf
sWrittenData = sWrittenData + "Total" + Chr(&H6) + "" + Chr(&H9) + Chr(&H1B) + Chr(&H69) + Chr(&H1) + Chr(&H1) + " $156.95" + vbCrLf 'Character Expansion - Pg. 3-10
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H69) + Chr(&H0) + Chr(&H0) 'Cancel Character Expansion - Pg. 3-10
sWrittenData = sWrittenData + "------------------------------------------------" + vbCrLf + vbCrLf
sWrittenData = sWrittenData + "Charge" + vbCrLf + "$159.95" + vbCrLf
sWrittenData = sWrittenData + "Visa XXXX-XXXX-XXXX-0123" + vbCrLf + vbCrLf
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H34) + "Refunds and Exchanges" + Chr(&H1B) + Chr(&H35) + vbNewLine 'Specify/Cencel White/Black Invert - Pg. 3-16
sWrittenData = sWrittenData + "Within " + Chr(&H1B) + Chr(&H2D) + Chr(&H1) + "30 days" + Chr(&H1B) + Chr(&H2D) + Chr(&H0) + " with receipt" + vbCrLf 'Specify/Cancel Underline Printing - Pg. 3-15
sWrittenData = sWrittenData + "And tags attached" + vbCrLf + vbCrLf
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H1D) + Chr(&H61) + Chr(&H1)
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H62) + Chr(&H6) + Chr(&H2) + Chr(&H2) + " 12ab34cd56" + Chr(&H1E) + vbCrLf 'Barcode - Pg. 3-39 - 3-40
sWrittenData = sWrittenData + Chr(&H1B) + Chr(&H64) + Chr(&O2) 'Cut - Pg. 3-41
sWrittenData = sWrittenData + Chr(&H7)
aku aja bngung tu untuk apa aja. hehe
buanyak kode untuk printer dot matrix
bagi yang bisa kasih komentar ya, buat sharing ilmu aja. maklum newbie tinggal copas
Posting Komentar