Kindly drop me mail at yogesh.mehla@gmail.com for source code
@InfotroneFactory3 жыл бұрын
if i change the esc/pos command to other printer command it can work? like TVS printer .IF i want change some esc/pos command how can i do it
@techsapphire3 жыл бұрын
You can customize source code which I share.
@yaseralhousen34803 жыл бұрын
thank you can i use it for asp core also? ...please code ?
@techsapphire3 жыл бұрын
share your email for code. Yes I provide commercial support for customization
@yaseralhousen34803 жыл бұрын
@@techsapphire yaser.m.alhousen@gmail.com
@techsapphire3 жыл бұрын
Sent, kindly check your email. Note: I also provide commercial support. Please contact if needed. If you find this solution helpful than donate comfortable amount on papal to my email ID or link www.paypal.me/bimlamehla . Donation is not mandatory, it is just a request to support free tutorials.
@mohammedsouban71124 жыл бұрын
hi. What is the c# code for getting item name, price, quantity and total from the user and print in thermal printer. ?
@techsapphire4 жыл бұрын
you can take code covered in video and play around it.
@alevak094 жыл бұрын
Everything works fine except the qr code doesn't get printed. Barcode on the other hand is printed fine. Can you help? Pos thermal printer printer support qr code printing and it is shown when we print test page.
@techsapphire4 жыл бұрын
Check if your printer supports QR code or not, Or if it is not Epson than code might be diff for that.
@alevak094 жыл бұрын
@@techsapphire I use Aures ODP 333 which is esc/pos compatible and support qr code.
@techsapphire4 жыл бұрын
@@alevak09 than you need to check what command it need for QR code
@arneskillz51707 жыл бұрын
Is this only for Epson Printer
@Berna09202 жыл бұрын
Hey! thanks for this tutorial, this can be used for other thermal printers? por example GHIA GTP801.
@techsapphire2 жыл бұрын
Yes, absolutely, for non english char you might need to experiment
@anilpillay21932 жыл бұрын
Using raw printing, how can i programmatically change the print side when the printer has 2 heads. Ie which esc sequence can i send to the printer. Something similar to what PosPrinter.ChangePrintSide from the .net sdk does
@techsapphire2 жыл бұрын
I don't have printer to test it so cannot suggest.
@anilpillay21932 жыл бұрын
@@techsapphire Rephrasing my question a bit. How can i switch between Slip and Roll printing programatically? Roll printing works but it does not switch to Slip printing mode
@anilpillay21932 жыл бұрын
Thanks anyways i was able to get the correct sequences 27 c 48 4 Slip 27 c 48 1 Roll its working now
@ibtissemsatla60865 жыл бұрын
Could i use this code on an other brand of printer rather tnan EPSON ?
@techsapphire5 жыл бұрын
For POS, code may change according to printer brand and even with model.
@amzaropanget7 ай бұрын
Good day, After deploying a Windows Form Application the printer gives error "tmpPrint.print is denied". Thank you
@mikaa31113 жыл бұрын
Hi Is this supported for Command Apps C# DotNet Core Framework?
@techsapphire3 жыл бұрын
yes
@reneqvist5 жыл бұрын
Is it possbile to set both height and width for a text print, it seems that the last setting you apply is the active one, so either the text is high or wide, but not both??PrintByteArray = PrintExtensions.AddBytes(PrintByteArray, obj.CharSize.DoubleHeight8()); PrintByteArray = PrintExtensions.AddBytes(PrintByteArray, obj.CharSize.DoubleWidth8());In this example the text gets wide, but not high??
@techsapphire5 жыл бұрын
POS printer need to reset. So once formatted text is printed, you can add normal font too. obj.CharSize.Normal();
@andrewpham9116 Жыл бұрын
Hi, I try your PrinterUtility NutGet work great for 32bits application. But my application build on 32 and 64bits on Visual Studio 2015. Do you have 64bit version? Can I have the source code or buy from you?
@SuperWolffighter7 жыл бұрын
Hello Sir, Now Everything Has Been Resolved. A very big thanks after all.
@techsapphire7 жыл бұрын
Sorry for late reply. Glad you found your fix.
@bramilgarcia60147 жыл бұрын
One question : this code change printer settings ? Because when using other programs that needs to print , the print comes out with different format
@sameersingh48025 жыл бұрын
After installing PritnerUitility & build code at .cs file there are showing two error are show :- Error 1) The type or namespace name 'PrinterUtility' could not be found (are you missing a using directive or an assembly reference?) 2) The primary reference "PrinterUtility, Version=1.0.2.0, Culture=neutral, processorArchitecture=x86" could not be resolved because it was built against the ".NETFramework,Version=v4.6.1" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.1".
@josemanuelgomez9013 жыл бұрын
Does it work with Epson printers only?
@techsapphire3 жыл бұрын
Generally esc commands are common, but still I encounter where printer use diff codes.
@martinmyers31692 жыл бұрын
Will it work if port will be ip adress of ip POS printer, not installed on Windows as a device? Like 192.168.1.10, for example?
@techsapphire2 жыл бұрын
yes it can work with network printer
@abdullahsaleem87574 жыл бұрын
I am having issue setting printer path. I've set it as you have told to do in the tutorial but I'm getting error "The Specified path is invalid" Can you please help me out with this?
@techsapphire4 жыл бұрын
Kindly check kzbin.info/www/bejne/g4vPfaxjr81_ars
@FgroupIndonesia4 жыл бұрын
do you have the library out there for open sourced?
@FgroupIndonesia4 жыл бұрын
i was wondering how to connect to usb thermal printer?
@techsapphire4 жыл бұрын
yes, you can share your email. I will mail you source code used. You just need printer name to print.
@FgroupIndonesia4 жыл бұрын
@@techsapphire why dont you stored it inside github? it's more open sourced...
@techsapphire4 жыл бұрын
@@FgroupIndonesia this is my business model, I gain communication with person. If he needs any commercial support than it is easy to ask if communication is already open
@jjvm5 жыл бұрын
Nice tutorial. Do you have any suggestions about how to print to the slip output of the printer? (ribbon ink)
@techsapphire5 жыл бұрын
if you are talking about epson t220, yes I know. But it is little different from this code.
@itshappening97606 жыл бұрын
What if we have list more than 2 items? Should we use for loop? Or..?
@techsapphire6 жыл бұрын
yes. Their is no concept of data binding so you need loop.
@itshappening97606 жыл бұрын
techsapphire and paper will automaticaly adjust height size? Also what if printer is not epson? Thanks
@techsapphire6 жыл бұрын
yes POS printer auto increase height.
@CaptainHarmonyLMAO6 жыл бұрын
Thank you for the code, it works perfect. Did you find a way to get feedback from the printer? Ideally, i would like to get a print response after each print command.
@techsapphire6 жыл бұрын
If you are using EPSON printer than use this video of mine, here I am using EPSON SDK, their we can get anything kzbin.info/www/bejne/a5axYnyoqZqJn7M
@udenakajayawardane907 Жыл бұрын
is this work only epson printers ?
@techsapphire Жыл бұрын
no most of esc printers
@yoemrattana5 жыл бұрын
Does it support unicode font?
@techsapphire5 жыл бұрын
Try this tutorial, if you want to different fonts kzbin.info/www/bejne/paSsaINnjsl_adE
@Karansidhu21905 жыл бұрын
Hi, will this work for a non epson printer too?
@techsapphire5 жыл бұрын
You can try generic printing solution. kzbin.info/www/bejne/paSsaINnjsl_adE
@emmysmith89605 жыл бұрын
Dear sir, thank u pls where can i insert this code and print when after adding what a client want to buy. am still new to this. thank u sir
@techsapphire5 жыл бұрын
Hi Emmy, code you need to modify as per your requirement. If you need I provide commercial support, you can reach me on skype yogesh.mehla@live.com
@emmysmith89605 жыл бұрын
@@techsapphire ok sir thank u
@dovantuan15927 жыл бұрын
Please help me open Cash drawer, which connected to Printer. Thanks!
@RupeshPRajan6 жыл бұрын
pls advise on how to get the printer path from the local system. Print method fails for me
@techsapphire6 жыл бұрын
use this tutorial to fix local printer issue. kzbin.info/www/bejne/g4vPfaxjr81_ars
@yongchen61177 жыл бұрын
And does this work on WPF? And how to open the cashier draw? Thanks
@techsapphire7 жыл бұрын
Yes it works in WPF like charm. I am mailing you code. In code print method seems to be problem with some developer so I made one more tutorial to have work around. I am mailing you link for that issue too.
@jayalgallenero71274 жыл бұрын
Nice tutorial. Is this for EPSON printer only?
@techsapphire4 жыл бұрын
it works with almost all escpos printers, but commands might change. You can try this video, it is about generic printing for all printers. kzbin.info/www/bejne/paSsaINnjsl_adE
@kathanpatel3677 Жыл бұрын
wroking all printer
@shahedkaiser70705 жыл бұрын
Thanks for sharing such a helpful tutorial. The code works only for epson printer or any other thermal printer? Can you please share the code?
@techsapphire5 жыл бұрын
please share your email id.
@shahedkaiser70705 жыл бұрын
@@techsapphire shahedexc@gmail.com
@shahedkaiser70705 жыл бұрын
@@techsapphire does your code work for all thermal printer or only for epson?
@techsapphire5 жыл бұрын
Code mostly work for epson or printer support esc/pos commands. for Generic solution use printdocument
@filbertsugianto89996 жыл бұрын
I want to ask why doublewidth not working in epson tm-u220. can you give me a hint?
@techsapphire6 жыл бұрын
Sorry Filbert, I can't suggest on that. I can share my code. For that you need to check printer specification and document explaining character set which print needs.
@anoop4real1155 жыл бұрын
Hi, Nice tutorial, I would like to know, is there a possibility to create a template and generate the receipt dynamically, for example in one template the store address is in the beginning and in the other template the address is at the last.... something like that??
@techsapphire5 жыл бұрын
Source code is available you can play with it.
@pathumniroshan61456 жыл бұрын
Great Video... Just one question... Is it working for all the POS printers?
@techsapphire6 жыл бұрын
If you check technical specification for any POS printer. They will mention character set. If they are passing EPSON character set simulator than this will work. Also IBM too.
@pathumniroshan61456 жыл бұрын
techsapphire thanks.. if it does not pass epson character set is there any other libraries like this that i can do this?
@techsapphire6 жыл бұрын
Usually most of the printer follows EPSON or IBM. So you need to check which it is. You can build for IBM if it doesn't works. These are character only so you can build one for your own.
@bliitzeg5 жыл бұрын
I tested the printer utility on Xamarin android and its works , I did some extra steps to print in a Bluetooth printer.
@techsapphire5 жыл бұрын
Please share source code. It will be help to community.
@ShaDoow0083 жыл бұрын
Excelent video, this only will work with epson printers??? and can u share the source code please... thanks in advance
@techsapphire3 жыл бұрын
Kindly share your email, it will work with most of them.
@johnmurphy26434 жыл бұрын
Hi, I can't seem to find the link to the code, can you pls share the link?
@techsapphire4 жыл бұрын
Kindly share your email.
@johnmurphy26434 жыл бұрын
@@techsapphire dev.notify5@gmail.com
@rosjat38424 жыл бұрын
Hello Mr. Yogesh, Thank you for this great tutorial. Is there a way to check if printing was successful? something like a callback
@techsapphire4 жыл бұрын
It is possible if you do status binding. kzbin.info/www/bejne/qoqnlq2ultSBl7M
@moyomartin45016 жыл бұрын
i want to pick the items from datagridview how can i go about that? i am coding in vb.net
@techsapphire6 жыл бұрын
code directly print text you supply. That's on you. You can supply from gridview or text box doesn't matter.
@s3t14d4rm46 жыл бұрын
I have EPSON TM-T82 with me, connected to my notebook/laptop through USB port. But everytime I tried to print with the printer path "\\\\\\EPSON TM-T82 Receipt", I always get "System.IO.IOException: The specified path is invalid". Have you experienced this issue before?
@techsapphire6 жыл бұрын
try this video kzbin.info/www/bejne/g4vPfaxjr81_ars
@MohitAggarwal88304 жыл бұрын
Hi. thanks for tutorial. Could you help me. I am receiving error "System.IO.IOException: 'A device attached to the system is not functioning." while using printer utility with everycom printer. but its working fine when I pass direct print command .
@techsapphire4 жыл бұрын
Can't suggest without looking into it
@MohitAggarwal88304 жыл бұрын
@@techsapphire Printer Utility is not support alphanumeric character in barcode. Please suggest if there is any alternative.
@techsapphire4 жыл бұрын
@@MohitAggarwal8830 Hi Mohit, try below code: public byte[] Code39(string code) { int height = 300; var command = new List {0x1D, 0x68, (byte)height, 0x1D, 0x77,(byte)2,0x1D, 0x6B, 0x45, (byte)code.Length }; command.AddRange(code.ToCharArray().Select(x => (byte)x)); return command.ToArray(); }
@MohitAggarwal88304 жыл бұрын
@@techsapphire Thanks for reply. Can we write big string (len=20) into barcode. If no How much char we can write?. Currently when I try it skip the barcode data and print the rest slip.
@hasnatqureshi11886 жыл бұрын
Mini Receipt Printer ARP-990KC I have this model thermal printer. Will this code works with that
@techsapphire6 жыл бұрын
no Idea, you need to try
@hasnatqureshi11886 жыл бұрын
@@techsapphire Sir thanks your code works with my printer. But I have a problem . I want two copies of receipts how I will do that
@techsapphire6 жыл бұрын
send print command 2 times. Its simple.
@hasnatqureshi11886 жыл бұрын
Sir it says that temp file is used by another process. That file is not deleting by your code
@techsapphire6 жыл бұрын
You can directly print file without temp file use this code public static bool SendValueToPrinter(string szPrinterName, Byte[] BytesValue) { Byte[] bytes = BytesValue; bool bSuccess = false; // Your unmanaged pointer. IntPtr pUnmanagedBytes = new IntPtr(0); int nLength = 0; nLength = Convert.ToInt32(bytes.Length); // Read the contents of the file into the array. // Allocate some unmanaged memory for those bytes. pUnmanagedBytes = Marshal.AllocCoTaskMem(nLength); // Copy the managed byte array into the unmanaged array. Marshal.Copy(bytes, 0, pUnmanagedBytes, nLength); // Send the unmanaged bytes to the printer. bSuccess = SendBytesToPrinter(szPrinterName, pUnmanagedBytes, nLength); // Free the unmanaged memory that you allocated earlier. Marshal.FreeCoTaskMem(pUnmanagedBytes); return bSuccess; } //RawPrinterHelper.SendValueToPrinter(PrinterName, BytesValue); Note:RawPrinterHelper you can find online
@roonamii7 жыл бұрын
in printing did you setup the paper size sir?
@techsapphire7 жыл бұрын
That depends upon your page size it varies form 30mm to 80 mm so you have to adjust spacing as per that.
@roonamii7 жыл бұрын
so when designing about the printing. I should know first what size of paper does POS printer used?
@jbamit0074 жыл бұрын
i am getting this error Could not load file or assembly 'PrinterUtility, Version=1.0.2.0
@techsapphire4 жыл бұрын
kindly check shared source code
@yongchen61177 жыл бұрын
Hi Sir, seems the barcode only accept number, not any letter. Any idea?
@arthurgapusan6 жыл бұрын
Hi. Im getting access to the path is denied? How to fix? Also can I use default printer
@techsapphire6 жыл бұрын
access is denied for which path ? You need to pass printer name
@techsapphire6 жыл бұрын
I think this link provides you solution to it kzbin.info/www/bejne/g4vPfaxjr81_ars
@krishnachaudhary53516 жыл бұрын
All the fonts looks similar, is there a way to add our own fonts?
@techsapphire6 жыл бұрын
for that u need to use SDK not generic text print
@krishnachaudhary53516 жыл бұрын
techsapphire can you recommend any sdk? Help really appreciated
@techsapphire6 жыл бұрын
sdk k printer specific. For Epson use epsont sdk for brother use brother. So no preference in that. Usually POS receipts are never customized with font, max logo's are used. Their purpose is to print fast only.
@touseefsultan7 жыл бұрын
An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll Additional information: Cannot create a file when that file already exists. which file??
@ssahinnkadir3 жыл бұрын
+1 :(
@shayanhasan31872 жыл бұрын
How to save the document?
@techsapphire2 жыл бұрын
you cannot save esc pos command print as preview
@mishraup5 жыл бұрын
Tharmal printer recept process?????
@techsapphire5 жыл бұрын
please elaborate, unable to get your point.
@mishraup5 жыл бұрын
Sir plz send me this project ambrishmishra.tz@gmail.com
@techsapphire5 жыл бұрын
Sent please check your email. Second version of video is also available. Where you can learn print using POS for .NET on epson printer : kzbin.info/www/bejne/a5axYnyoqZqJn7M Where you can learn to print directly from web browser. kzbin.info/www/bejne/g4KwdWeGl5ydsLs
@venudesaraju69987 жыл бұрын
Hi Sir I am in the process of developing a pos system. Can I use the print code that you have mailed? I am sure I might need to make a few changes. Regards VENU
@techsapphire7 жыл бұрын
yes you can use. Play with code as you want.
@mohamedbouhani62945 жыл бұрын
Wich way is the best for a better flexibility like font, color, text arrangement for printing, using a report like let's say Quick repor or the Microsoft's RawPrinterHelpler.cs class ? thank's for the tutorial. Any other solution using an SDK is welcome.
@techsapphire5 жыл бұрын
Rawprinting is very simple and limited, you don't have much to customize there. But you can use POS for .NET specialy with EPSON, Zebra and Citizen printer. With POS for .NET you can do amazing things. I have already recorded on lecture on it, you can try this : kzbin.info/www/bejne/a5axYnyoqZqJn7M
@SuperWolffighter7 жыл бұрын
Hello Sir, I could manage to print out but stuck at its not cut out after finishing the print. I have select 'No Cash Drawer' in Printer Properties. Please help me. Waiting for your kind reply. Best Regards
@sbtiancz7 жыл бұрын
is there any way for it to work from a web application, I worked locally, but I need it to work from the web client, Thank you if you can help me.
@techsapphire7 жыл бұрын
You can create chrome or firefox extn. Than u can print using that. Directly you can't do.
@RajKumar-qj6nl6 жыл бұрын
Hi bro, how to connect to a epson ethernet type printer tm-t88v via c# (ip printer via c#) any suggestions!
@techsapphire6 жыл бұрын
You can do by using address along with printer name.
@RajKumar-qj6nl6 жыл бұрын
Thanks bro... could u possibly share me the source code with ethernet type connection to rajkumarbtech4@gmail.com, it would be great if i could look into your code further.
@techsapphire6 жыл бұрын
Sent please check your email. Second version of video is also available. Where you can learn to print directly from web browser. kzbin.info/www/bejne/g4KwdWeGl5ydsLs
@yamasu43336 жыл бұрын
I'm getting this exception, can tell me the work around for that ? "An exception of type 'System.IO.IOException' occurred in mscorlib.dll but was not handled in user code Additional information: The network name cannot be found." It was working good but suddenly started giving this exception.... I'm working with ASP MVC5 WebProject.
@techsapphire6 жыл бұрын
If you face exception "Error the network name cannot be found" during printing. Than use below link to make work around. www.techsapphire.in/index/pos_printer_error_the_network_name_cannot_be_found/0-184
@yamasu43336 жыл бұрын
Thanks For reply :) please tell me where to use this code ? if (File.Exists(".\\tmpPrint.print")) File.Delete(".\\tmpPrint.print"); File.WriteAllBytes(".\\tmpPrint.print", BytesValue); RawPrinterHelper.SendFileToPrinter("POS1", ".\\tmpPrint.print"); try { File.Delete(".\\tmpPrint.print"); } catch { }
@techsapphire6 жыл бұрын
mailed you code to print without temp file.
@yamasu43336 жыл бұрын
Thanks Man. It Worked :) You'r great man!! I Appreciate that.
@yamasu43336 жыл бұрын
One thing more, If have some Clients of this application then this code can also work for them to print receipt from their computers ??
@Faracus7 жыл бұрын
How did you figure out the settings for your Cut Page? Is it part of ESC/POS commands?
@techsapphire7 жыл бұрын
It is there Faracus in code.
@malikarslan56385 жыл бұрын
i have to print receipt on thermal printer for a pharmacy. kindly send me this code plz
@techsapphire5 жыл бұрын
please share your email id
@malikarslan56385 жыл бұрын
@@techsapphire malikarslan160572@gmail.com
@malikarslan56385 жыл бұрын
Actually I have to print my data table ( which contains item , qty and subtotal ) so where and how can i add my data table in it. Plz guide me.
@techsapphire5 жыл бұрын
I have mailed you code. Please customize as per you need. I provide commercial support if needed.
@johnibasha67655 жыл бұрын
@@techsapphire Hai I need to prind data in a4 sheet but multiple of items data in multiple particion box's in a4 sheet 7013338512 my contact number Raihaan.october6@gmail.com My mail ID please help me
@sumeetpatel68446 жыл бұрын
hi, yogesh. your code is working very fine. Thanks for such an example video? what if i wanted to print same from my web application???? can you help me out for that ???
@techsapphire6 жыл бұрын
sent you mail
@sumeetpatel68446 жыл бұрын
@@techsapphire thank you so much. Glad that you replied so quickly.
@mohamedel-zohary79485 жыл бұрын
is this code can work on sprt sp-pos88v ?
@techsapphire5 жыл бұрын
You can test, if it doesn't work you can try print document.
@myDrone12 жыл бұрын
Thanks for sharing. Do you have the source code for this example?
@techsapphire2 жыл бұрын
share your email or mail me at yogesh.mehla@gmail.com
@kharulli7 жыл бұрын
hi. thanks for tutorial. Could you help me to set paper size? I tried to google the documentation but failed. thanks
@techsapphire7 жыл бұрын
Hi Mohamad you need to test by printing as size of EPOS printer vary as per paper size. No predefined configuration comes. Share your email ID I will mail you project so that you can reference it,
@kharulli7 жыл бұрын
Hi Yogesh, Thanks for quick reply. Kindly send the project to kharulli@gmail.com
@mariaioannidou59646 жыл бұрын
Hello. i have a problem with QrCode. I can't pritn it. it prints ???????. can you help please?
@techsapphire6 жыл бұрын
Hi Maria, you need to check if your printer support qr code. My code is mainly tested on epson printer though it works on all esc/pos device.
@mariaioannidou59646 жыл бұрын
@@techsapphire Thanks for your response. My thermal printer is GPrinter and i've tested it only to print a Png with Qrcode. If it doesn't support Qrcode i can't use PrinterUtility package?
@techsapphire6 жыл бұрын
If it doesn't support QR code than you can use some third party dll to generate QR code in image and use that image to print via printer. If your printer is not supporting, you can't do any thing other than that. If my solution help you, you can support me by doing some donation on link: paypal.me/yogeshmehla Donation help in keeping free community work. Sent please check your email. Second version of video is also available. Where you can learn print using POS for .NET on epson printer : kzbin.info/www/bejne/a5axYnyoqZqJn7M Where you can learn to print directly from web browser. kzbin.info/www/bejne/g4KwdWeGl5ydsLs
@fabiolira58065 жыл бұрын
How to print in asp.net mvc side client?
@techsapphire5 жыл бұрын
Please check this solution, this will help you kzbin.info/www/bejne/g4KwdWeGl5ydsLs
@diegocastro72077 жыл бұрын
Hello I would like to know where I can find the package documentation, or if you can send me the video code thanks
@techsapphire7 жыл бұрын
Send your email ID I can share code. You can re engineer code by yourself too.
@cybertron15277 жыл бұрын
Does this code work for all printers in the market or just epson ??
@techsapphire7 жыл бұрын
It work with all POS printers. As basic marking for all text printers are same. But only POS for normal printer you need to use crystal report or RDLC type reporting standards.
@cybertron15277 жыл бұрын
thanks for the insights :)
@abozanona7 жыл бұрын
Hello, Could you please attach the code in the description?
@techsapphire7 жыл бұрын
share your email, I will mail code to you.
@RZM1076 жыл бұрын
When I print the logo, it comes out with white lines. How can i fix it.
@techsapphire6 жыл бұрын
Don't use big image, resize it to small, also use black and white image for logo.
@DanielSoares762 жыл бұрын
Hello Mr. Yogesh, thanks for this tutorial. Can I have the source code of this one, please ?
@techsapphire2 жыл бұрын
Kindly share your email or mail me at yogesh.mehla@gmail.com
@mainuddinjamadar49477 жыл бұрын
Hello sir, Every thing is working fine , is it possible to change the printing language to hindi or else any indian regional language.I m currently using epson thermal tmt82-printer.
@techsapphire7 жыл бұрын
Below code worked for Chinese so try to find encoding for Hindi: var encoding = Encoding.GetEncoding(936); // convert the text into a byte array byte[] source = Encoding.Unicode.GetBytes("百順藥房");
@hfloresj266 жыл бұрын
I am making a software and I need to print on the client side since it is from an asp.net web portal c #, and the client will enter a web page published on the internet, not on the intranet, is this possible?
@techsapphire6 жыл бұрын
Hi Hector second version of this video is also available. Where you can learn to print directly from web browser. kzbin.info/www/bejne/g4KwdWeGl5ydsLs
@hfloresj266 жыл бұрын
this is my code protected void Page_Load(object sender, EventArgs e) { PrinterUtility.EscPosEpsonCommands.EscPosEpson obj = new PrinterUtility.EscPosEpsonCommands.EscPosEpson(); System.Drawing.Image img = System.Drawing.Image.FromFile(Server.MapPath("/Images/TechComLogoMovil.jpg")); byte[] BytesValue; using (MemoryStream ms = new MemoryStream()) { img.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); BytesValue = ms.ToArray(); } BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Separator()); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.CharSize.DoubleWidth6()); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.FontSelect.FontA()); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Alignment.Center()); BytesValue = PrintExtensions.AddBytes(BytesValue, Encoding.ASCII.GetBytes("Title ")); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.CharSize.DoubleWidth4()); BytesValue = PrintExtensions.AddBytes(BytesValue, Encoding.ASCII.GetBytes("Sub Title ")); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.CharSize.Nomarl()); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Separator()); BytesValue = PrintExtensions.AddBytes(BytesValue, Encoding.ASCII.GetBytes("Invoice ")); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Alignment.Left()); BytesValue = PrintExtensions.AddBytes(BytesValue, Encoding.ASCII.GetBytes("Invoice No. : 123 ")); BytesValue = PrintExtensions.AddBytes(BytesValue, Encoding.ASCII.GetBytes("Date. : 08/04/2018 ")); BytesValue = PrintExtensions.AddBytes(BytesValue, Encoding.ASCII.GetBytes("Itm Qty Net Total ")); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Separator()); BytesValue = PrintExtensions.AddBytes(BytesValue, string.Format("{0,-40}{1,6}{2,9}{3,9:N2} ", "item1", 12, 11, 144.00)); BytesValue = PrintExtensions.AddBytes(BytesValue, string.Format("{0,-40}{1,6}{2,9}{3,9:N2} ", "item2", 10, 15, 184.00)); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Alignment.Right()); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Separator()); BytesValue = PrintExtensions.AddBytes(BytesValue, Encoding.ASCII.GetBytes("Total ")); BytesValue = PrintExtensions.AddBytes(BytesValue, Encoding.ASCII.GetBytes("288.00 ")); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Separator()); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Lf()); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Alignment.Left()); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Alignment.Center()); //BytesValue = PrintExtensions.AddBytes(BytesValue, obj.BarCode.Code128("12345")); //BytesValue = PrintExtensions.AddBytes(BytesValue, obj.QrCode.Print("12345",PrinterUtility.Enums.QrCodeSize.Medio)); BytesValue = PrintExtensions.AddBytes(BytesValue, "------- Gracias por visitarnos ------"); BytesValue = PrintExtensions.AddBytes(BytesValue, obj.Alignment.Left()); BytesValue = PrintExtensions.AddBytes(BytesValue, CutPage()); // PrinterUtility.PrintExtensions.Print(BytesValue, @"\\LOCALHOST\XP"); Context.Response.BinaryWrite(BytesValue); } public Byte[] CutPage() { List oby = new List(); oby.Add(Convert.ToByte(Convert.ToChar(0x1D))); oby.Add(Convert.ToByte('V')); oby.Add((byte)66); oby.Add((byte)3); return oby.ToArray(); } but when I send the bytes to context.response.binarywrite it just shows me trash, do you have an email to send you the sample project and what it shows me?
@techsapphire6 жыл бұрын
Sure share me your email id please
@hfloresj266 жыл бұрын
hector.floresj@gmail.com
@techsapphire6 жыл бұрын
sent please check your email
@jbaldarr7 жыл бұрын
Hello, I would like to obtain the source code of this example, I can not find it on your site. Thanks for the Video.
@techsapphire7 жыл бұрын
Please share your email id
@wimblesoft7 жыл бұрын
I need beeping hex code for a ESC/POS. I couldn't find a working one. I need help so bad.
@techsapphire7 жыл бұрын
I can only share my solution my friend. I did it long time ago I don't have setup to try new things.
@wimblesoft7 жыл бұрын
techsapphire thanks anyway. I'm fucked up I think
@techsapphire7 жыл бұрын
sorry man for not being more help
@arturovargas15396 жыл бұрын
HI, how can initialize var BytesValue without GetLogo(); ??
@techsapphire6 жыл бұрын
you can initialize to bytesarray.
@pavankumargopa5 жыл бұрын
Can you share the project code that is available in Video?
@techsapphire5 жыл бұрын
share your email id
@pavankumargopa5 жыл бұрын
@@techsapphire pavan14323@gmail.com
@pavankumargopa5 жыл бұрын
Can you share me the code Today
@techsapphire5 жыл бұрын
sent please check
@binkugv6 жыл бұрын
Hi tech Saphire... I was using your way of printing for last one year and is very useful..but can you please advice me how can i add a line of arabic string in the print..i tried to do it like below.. bytes = PrintExtensions.AddBytes(bytes, Encoding.ASCII.GetBytes("Tax Invoice ")); bytes = PrintExtensions.AddBytes(bytes, System.Text.Encoding.Unicode.GetBytes("فاتورة ضريبية")); bytes = PrintExtensions.AddBytes(bytes, System.Text.Encoding.UTF32.GetBytes("فاتورة ضريبية"));
@techsapphire6 жыл бұрын
you can try something like this : var encoding = Encoding.GetEncoding(936); // convert the text into a byte array byte[] source = Encoding.Unicode.GetBytes("百順藥房");
@techsapphire6 жыл бұрын
Or if you are using EPSON printer check my this tutorial :POS for .NET on epson printer : kzbin.info/www/bejne/a5axYnyoqZqJn7M
@binkugv6 жыл бұрын
@@techsapphire sorry iam not using Epson printer ...I have to go with your first option ..but can you please confirm whether there is a typo because I cannot see u used encoding ...but used Normal Encoding
@binkugv7 жыл бұрын
IT works Like a charm Thanks Very much , But Cash Drawer connected to Reciept Printer not Opening (not on all cases) .Can you guess what may be the issue so that we can update it to this?
@binkugv7 жыл бұрын
Sorry I figured it Out add string eClear = ('' + "@"); string eDrawer = (eClear + ('' + ("p" + ('\0' + ".}")))); BytesValue = PrintExtensions.AddBytes(BytesValue, eDrawer); after rintExtensions.AddBytes(BytesValue, CutPage());
@techsapphire7 жыл бұрын
Glad my tutorial helped you :)
@rajeshraju30857 жыл бұрын
please send me the full source code to rajeshraju002@gmail.com
@techsapphire7 жыл бұрын
sent please check your email.
@dovantuan15927 жыл бұрын
Please help me open cash drawer, thank you!
@Nirgaya6 жыл бұрын
Superb Effort. Nicely done...
@senasena342311 ай бұрын
hello sir, can I get the source code of this?
@techsapphire11 ай бұрын
kindly mail at yogesh.mehla@gmail.com
@subhangamers7 жыл бұрын
Hi Yogesh dear receipt is not printing to my printer i am using 3 inch thermal printer when i press print button i get an error the file is already exist you cannot print
@NaumHN3 жыл бұрын
Excellent video. I am new in c#. Can I have the source code of this one please? Thank You
@techsapphire3 жыл бұрын
Kindly mail me at yogesh.mehla@gmail.com for source code or leave your email in comment.
@kathanpatel3677 Жыл бұрын
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Printing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using PrinterUtility; namespace printertesttvs { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { PrinterSettings printerSettings = new PrinterSettings(); printerSettings.PrinterName = "YourPrinterName"; printerSettings.DefaultPageSettings.PaperSize = new PaperSize("Custom", 300, 150); // Create a PrintDocument object and assign the printer settings to it PrintDocument printDoc = new PrintDocument(); printDoc.PrinterSettings = printerSettings; // Add a PrintPage event handler to the PrintDocument object printDoc.PrintPage += new PrintPageEventHandler(PrintPage); // Call the Print method on the PrintDocument object to print the document printDoc.Print(); } void PrintPage(object sender, PrintPageEventArgs e) { // Define the font and brush for the text Font font = new Font("Arial", 10); Brush brush = Brushes.Black; // Define the text to be printed string headerText = "કર્ણાવતી એગ્રીકલ્ચર માર્કેટ યાર્ડ"; string dateText = "Date: 3/23/2023"; string item1Text = "Item 1: 10.00"; string item2Text = "Item 2: 20.00"; string totalText = "Total: 30.00"; // Define the position and spacing for the text float xPos = 0; float yPos = 0; float ySpacing = 20; // Draw the header text e.Graphics.DrawString(headerText, font, brush, xPos, yPos); yPos += ySpacing; // Draw the date text e.Graphics.DrawString(dateText, font, brush, xPos, yPos); yPos += ySpacing; // Draw the item 1 text e.Graphics.DrawString(item1Text, font, brush, xPos, yPos); yPos += ySpacing; // Draw the item 2 text e.Graphics.DrawString(item2Text, font, brush, xPos, yPos); yPos += ySpacing; // Draw the total text e.Graphics.DrawString(totalText, font, brush, xPos, yPos); yPos += ySpacing; } } }
@girmayhadush9958 Жыл бұрын
where is the link thoa?
@haroldespinosa48544 жыл бұрын
Can i have a copy of the source code?
@techsapphire4 жыл бұрын
Sent, kindly check your email. Note: I also provide commercial support. Please contact if needed. If you find this solution helpful than donate comfortable amount on papal to my email ID or link www.paypal.me/bimlamehla Donation is not mandatory is it just request to support free tutorials.
@marcelsigolo92336 жыл бұрын
Great video ... I'm trying to use a solution in linux with a local printer how do I? Do you have an example of how to call this printer being shared? I also saw rawPrinterHelper but winspol.drv is unique to windows. If you have any tips .... Thanks
@techsapphire6 жыл бұрын
Sorry I haven't worked o linux solution.
@marcelsigolo92336 жыл бұрын
But do you have any suggestions for me to be able to perform this process on linux? If you have something, it will be of great help. Thank you
@thewilkinsons20106 жыл бұрын
I am having some issues also. May I get the sourcecode?
@thewilkinsons20106 жыл бұрын
jkwilkinson99@juno.com
@techsapphire6 жыл бұрын
Sent please check your email. Second version of video is also available. Where you can learn print using POS for .NET on epson printer : kzbin.info/www/bejne/a5axYnyoqZqJn7M Where you can learn to print directly from web browser. kzbin.info/www/bejne/g4KwdWeGl5ydsLs
@samuelreyeslara52487 жыл бұрын
Hello, its posible to get that code?
@techsapphire7 жыл бұрын
sent please check your email.
@samuelreyeslara52487 жыл бұрын
THANKS!!!!!!
@manishgoswami34557 жыл бұрын
Hi.. I am getting error while printing alphanumeric character in barcode
@techsapphire7 жыл бұрын
yes it will give error. In general in stores you will never see alpha numeric barcode. Item number are always character. So common POS don't support alpha numeric barcodes.
@manishgoswami34557 жыл бұрын
techsapphire Thanks... But is there any alternative ? And one more question auto cut receipt how to implement that. One you had given Not working. I tested same on Epson and TVS 2 different model everything is working perfectly except alphanumeric barcode and auto cut
@techsapphire7 жыл бұрын
yes alternative is available but for that you have to use POSfornet SDK using EPSON api's. Which I never used. Auto cut code is available in code I shared.
@manishgoswami34557 жыл бұрын
techsapphire hi.. Is it possible to build in lower version of. Net framework. It's not working in 2.0
@techsapphire7 жыл бұрын
can't say. You can decompile library with jetbrains and try to compile it again with 2.0 framework. And see if that works.
@sharjeelkhan97347 жыл бұрын
how to check printer availability?
@techsapphire7 жыл бұрын
Sorry I don't have sample code for that. You need to google it ourself.
@sharjeelkhan97347 жыл бұрын
thanku bro please email me this code b013.052@gmail.com
@techsapphire7 жыл бұрын
sent please check your email.
@sharjeelkhan97347 жыл бұрын
Thanku so much :)
@ThiagoMartins-x6i Жыл бұрын
ty for the tutorial, can i have the source code pls?
@techsapphire Жыл бұрын
Kindly reach me at yogesh.mehla@gmail.com
@salahthabet66907 жыл бұрын
Does it support the Arabic characters ?
@techsapphire7 жыл бұрын
Below code worked for Chinese so try to find encoding for Arabic: var encoding = Encoding.GetEncoding(936); // convert the text into a byte array byte[] source = Encoding.Unicode.GetBytes("百順藥房"); // convert that byte array to the new codepage. byte[] converted = Encoding.Convert(Encoding.Unicode, encoding, source); // Perform the conversion from one encoding to the other. BytesValue = PrintExtensions.AddBytes(BytesValue, converted );
@techsapphire7 жыл бұрын
try with this Encoding.GetEncoding("windows-1256")
@salahthabet66907 жыл бұрын
Thank you for your reply, i will try it.
@robderop3762 жыл бұрын
hello, can i please have a copy of the source code? am having trouble with a project like this. thanks a lot for your video!
@techsapphire2 жыл бұрын
send mail at yogesh.mehla@gmail.com
@haroldhong86456 жыл бұрын
hello sir, can I use this in vb.net?
@techsapphire6 жыл бұрын
yes you can use any .net supported language
@johnyor847 жыл бұрын
May I ask you for code or example ? thank you
@techsapphire7 жыл бұрын
Please share your email id
@johnyor847 жыл бұрын
techsapphire johnyor@gmail.com
@techsapphire7 жыл бұрын
sent please check your email inbox
@aasaid1003 жыл бұрын
good job can you put the link to download the project please thank you
@techsapphire3 жыл бұрын
kindly share your email.
@bledarbregu78733 жыл бұрын
Thank you for the tutorial. I'm having trouble finding documentation about this library. Can you send me the source code please? It would help a lot... Thank you
@techsapphire3 жыл бұрын
Kindly share your email
@techsapphire3 жыл бұрын
@@sweaterhijauzzz sent kindly check your email. Note: I also provide commercial support. Please contact if needed. If you find this solution helpful than donate comfortable amount on papal to my email ID or link www.paypal.me/bimlamehla . Donation is not mandatory, it is just a request to support free tutorials.
@shreeannasagar37103 жыл бұрын
Thank you so much for the tutorial.can u please share code sir. Thanku 😊
@techsapphire3 жыл бұрын
Sent, kindly check your email. Note: I also provide commercial support. Please contact me if needed. If you find this solution helpful than donate comfortable amount on papal to my email ID or link www.paypal.me/bimlamehla. Donation is not mandatory, it is just a request to support free tutorials.
@hoaxbuster518 Жыл бұрын
Hi, thanks for this. Can you please send me the source code? I stuck in printing the receipt for days now. Many thanks!
@techsapphire Жыл бұрын
Kindly mail me at yogesh.mehla@gmail.com for the code
@bahadrkazmazoglu68462 жыл бұрын
Thank you for the tutorial. Can I have the source code of this one please ?
@techsapphire2 жыл бұрын
Kindly share your email or send me mail at yogesh.mehla@gmail.com
@kathanpatel3677 Жыл бұрын
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Printing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using PrinterUtility; namespace printertesttvs { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { PrinterSettings printerSettings = new PrinterSettings(); printerSettings.PrinterName = "YourPrinterName"; printerSettings.DefaultPageSettings.PaperSize = new PaperSize("Custom", 300, 150); // Create a PrintDocument object and assign the printer settings to it PrintDocument printDoc = new PrintDocument(); printDoc.PrinterSettings = printerSettings; // Add a PrintPage event handler to the PrintDocument object printDoc.PrintPage += new PrintPageEventHandler(PrintPage); // Call the Print method on the PrintDocument object to print the document printDoc.Print(); } void PrintPage(object sender, PrintPageEventArgs e) { // Define the font and brush for the text Font font = new Font("Arial", 10); Brush brush = Brushes.Black; // Define the text to be printed string headerText = "કર્ણાવતી એગ્રીકલ્ચર માર્કેટ યાર્ડ"; string dateText = "Date: 3/23/2023"; string item1Text = "Item 1: 10.00"; string item2Text = "Item 2: 20.00"; string totalText = "Total: 30.00"; // Define the position and spacing for the text float xPos = 0; float yPos = 0; float ySpacing = 20; // Draw the header text e.Graphics.DrawString(headerText, font, brush, xPos, yPos); yPos += ySpacing; // Draw the date text e.Graphics.DrawString(dateText, font, brush, xPos, yPos); yPos += ySpacing; // Draw the item 1 text e.Graphics.DrawString(item1Text, font, brush, xPos, yPos); yPos += ySpacing; // Draw the item 2 text e.Graphics.DrawString(item2Text, font, brush, xPos, yPos); yPos += ySpacing; // Draw the total text e.Graphics.DrawString(totalText, font, brush, xPos, yPos); yPos += ySpacing; } } }
@VUAcademy19 ай бұрын
Thanku for video. can you share code. will be very thankufull