POS receipt report using c# complete - Fast receipt printing solution

Поделиться
HTML-код
  • Опубликовано: 20 сен 2024

Комментарии • 2 тыс.

  • @SuperWolffighter
    @SuperWolffighter 6 лет назад

    Hello Sir, Now Everything Has Been Resolved. A very big thanks after all.

    • @techsapphire
      @techsapphire  6 лет назад

      Sorry for late reply. Glad you found your fix.

  • @amzaropanget
    @amzaropanget 4 месяца назад

    Good day, After deploying a Windows Form Application the printer gives error "tmpPrint.print is denied". Thank you

  • @bramilgarcia6014
    @bramilgarcia6014 7 лет назад +1

    One question : this code change printer settings ? Because when using other programs that needs to print , the print comes out with different format

  • @bliitzeg
    @bliitzeg 5 лет назад

    I tested the printer utility on Xamarin android and its works , I did some extra steps to print in a Bluetooth printer.

    • @techsapphire
      @techsapphire  5 лет назад

      Please share source code. It will be help to community.

  • @georgechry5437
    @georgechry5437 6 лет назад +1

    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.

    • @techsapphire
      @techsapphire  6 лет назад

      If you are using EPSON printer than use this video of mine, here I am using EPSON SDK, their we can get anything ruclips.net/video/5eN1Irt5ViQ/видео.html

  • @sameersingh4802
    @sameersingh4802 4 года назад

    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".

  • @Nirgaya
    @Nirgaya 6 лет назад

    Superb Effort. Nicely done...

  • @InfotroneFactory
    @InfotroneFactory 3 года назад +1

    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

    • @techsapphire
      @techsapphire  3 года назад

      You can customize source code which I share.

  • @rosjat3842
    @rosjat3842 4 года назад

    Hello Mr. Yogesh, Thank you for this great tutorial. Is there a way to check if printing was successful? something like a callback

    • @techsapphire
      @techsapphire  4 года назад

      It is possible if you do status binding. ruclips.net/video/tYDezxaoNaQ/видео.html

  • @jjvm
    @jjvm 4 года назад

    Nice tutorial. Do you have any suggestions about how to print to the slip output of the printer? (ribbon ink)

    • @techsapphire
      @techsapphire  4 года назад

      if you are talking about epson t220, yes I know. But it is little different from this code.

  • @alevak09
    @alevak09 3 года назад

    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.

    • @techsapphire
      @techsapphire  3 года назад

      Check if your printer supports QR code or not, Or if it is not Epson than code might be diff for that.

    • @alevak09
      @alevak09 3 года назад

      @@techsapphire I use Aures ODP 333 which is esc/pos compatible and support qr code.

    • @techsapphire
      @techsapphire  3 года назад

      @@alevak09 than you need to check what command it need for QR code

  • @touseefsultan
    @touseefsultan 7 лет назад +1

    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??

  • @sahirelyllanes1678
    @sahirelyllanes1678 2 года назад

    Hi! thanks a lot for this tutorial. is there a way to print horizontally? i mean, like in a Check?

    • @techsapphire
      @techsapphire  2 года назад

      Every thing has esccmd for it, you need to experiment it, else I provide commercial support.

  • @subhangamers
    @subhangamers 7 лет назад

    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

  • @SuperWolffighter
    @SuperWolffighter 6 лет назад

    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

  • @arneskillz5170
    @arneskillz5170 7 лет назад +2

    Is this only for Epson Printer

  • @elvingonzalez8932
    @elvingonzalez8932 Год назад +1

    hello, where do we find the library please

    • @techsapphire
      @techsapphire  Год назад

      Kindly drop me mail at yogesh.mehla@gmail.com for source code

  • @reneqvist
    @reneqvist 5 лет назад

    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??

    • @techsapphire
      @techsapphire  5 лет назад

      POS printer need to reset. So once formatted text is printed, you can add normal font too. obj.CharSize.Normal();

  • @anoop4real115
    @anoop4real115 5 лет назад

    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??

    • @techsapphire
      @techsapphire  5 лет назад

      Source code is available you can play with it.

  • @Berna0920
    @Berna0920 2 года назад

    Hey! thanks for this tutorial, this can be used for other thermal printers? por example GHIA GTP801.

    • @techsapphire
      @techsapphire  2 года назад

      Yes, absolutely, for non english char you might need to experiment

  • @pathumniroshan6145
    @pathumniroshan6145 6 лет назад

    Great Video... Just one question... Is it working for all the POS printers?

    • @techsapphire
      @techsapphire  6 лет назад

      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.

    • @pathumniroshan6145
      @pathumniroshan6145 6 лет назад

      techsapphire thanks.. if it does not pass epson character set is there any other libraries like this that i can do this?

    • @techsapphire
      @techsapphire  6 лет назад

      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.

  • @mohammedsouban7112
    @mohammedsouban7112 3 года назад

    hi. What is the c# code for getting item name, price, quantity and total from the user and print in thermal printer. ?

    • @techsapphire
      @techsapphire  3 года назад

      you can take code covered in video and play around it.

  • @andrewpham9116
    @andrewpham9116 11 месяцев назад

    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?

  • @s3t14d4rm4
    @s3t14d4rm4 5 лет назад

    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?

    • @techsapphire
      @techsapphire  5 лет назад

      try this video ruclips.net/video/MZlLy-zhL4Y/видео.html

  • @jackdelvard742
    @jackdelvard742 4 года назад +1

    Thank you for the tutorial. Glad that you recommended this one to me .... Can I have the source code of this one please ?
    Thank again for the great job you're doing.

    • @techsapphire
      @techsapphire  4 года назад +1

      Sent, kindly check your email. Other Tutorials:
      POS printing using POS for .NET. ruclips.net/video/5eN1Irt5ViQ/видео.html
      Also 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
      For text formatting please refer this lecture:
      ruclips.net/video/3IcJWpw6wL8/видео.html
      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.Video tutorial to support all printer brand for POS print: ruclips.net/video/osI7P1YdL3o/видео.html

  • @jayalgallenero7127
    @jayalgallenero7127 4 года назад

    Nice tutorial. Is this for EPSON printer only?

    • @techsapphire
      @techsapphire  4 года назад

      it works with almost all escpos printers, but commands might change. You can try this video, it is about generic printing for all printers. ruclips.net/video/osI7P1YdL3o/видео.html

    • @kathanpatel3677
      @kathanpatel3677 Год назад

      wroking all printer

  • @abdullahsaleem8757
    @abdullahsaleem8757 4 года назад

    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?

    • @techsapphire
      @techsapphire  4 года назад

      Kindly check ruclips.net/video/MZlLy-zhL4Y/видео.html

  • @dovantuan1592
    @dovantuan1592 6 лет назад

    Please help me open Cash drawer, which connected to Printer. Thanks!

  • @shahedkaiser7070
    @shahedkaiser7070 5 лет назад

    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?

    • @techsapphire
      @techsapphire  5 лет назад

      please share your email id.

    • @shahedkaiser7070
      @shahedkaiser7070 5 лет назад

      @@techsapphire shahedexc@gmail.com

    • @shahedkaiser7070
      @shahedkaiser7070 5 лет назад

      @@techsapphire does your code work for all thermal printer or only for epson?

    • @techsapphire
      @techsapphire  5 лет назад

      Code mostly work for epson or printer support esc/pos commands. for Generic solution use printdocument

  • @yongchen6117
    @yongchen6117 7 лет назад

    Hi Sir, seems the barcode only accept number, not any letter. Any idea?

  • @ShaDoow008
    @ShaDoow008 3 года назад

    Excelent video, this only will work with epson printers??? and can u share the source code please... thanks in advance

    • @techsapphire
      @techsapphire  3 года назад

      Kindly share your email, it will work with most of them.

  • @Faracus
    @Faracus 7 лет назад

    How did you figure out the settings for your Cut Page? Is it part of ESC/POS commands?

  • @venudesaraju6998
    @venudesaraju6998 7 лет назад

    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

    • @techsapphire
      @techsapphire  7 лет назад

      yes you can use. Play with code as you want.

  • @mainuddinjamadar4947
    @mainuddinjamadar4947 7 лет назад

    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.

    • @techsapphire
      @techsapphire  7 лет назад

      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("百順藥房");

  • @bliitzeg
    @bliitzeg 5 лет назад

    I modified the part to the printer name to print in a generic thermal printer and also I used code of....
    PrinterUtility.EscPosEpsonCommands.EscPosEpson obj = new PrinterUtility.EscPosEpsonCommands.EscPosEpson();

    br = PrintExtensions.AddBytes(br, obj.CharSize.DoubleWidth6());
    br = PrintExtensions.AddBytes(br, obj.FontSelect.FontA());
    br = PrintExtensions.AddBytes(br, obj.Alignment.Center());
    br = PrintExtensions.AddBytes(br,Encoding.ASCII.GetBytes("test
    "));
    and works for UWP app for silent print, I hope to help someone with this.
    You need to have min version of fall creators update allows you to install Printer Utility on nuget package.

  • @sumeetpatel6844
    @sumeetpatel6844 5 лет назад

    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 ???

    • @techsapphire
      @techsapphire  5 лет назад

      sent you mail

    • @sumeetpatel6844
      @sumeetpatel6844 5 лет назад

      @@techsapphire thank you so much. Glad that you replied so quickly.

  • @bramilgarcia6014
    @bramilgarcia6014 7 лет назад

    Excellent work!!

  • @mohamedbouhani6294
    @mohamedbouhani6294 5 лет назад

    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.

    • @techsapphire
      @techsapphire  5 лет назад

      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 : ruclips.net/video/5eN1Irt5ViQ/видео.html

  • @anilpillay2193
    @anilpillay2193 2 года назад

    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

    • @techsapphire
      @techsapphire  2 года назад +1

      I don't have printer to test it so cannot suggest.

    • @anilpillay2193
      @anilpillay2193 2 года назад

      @@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

    • @anilpillay2193
      @anilpillay2193 2 года назад +1

      Thanks anyways i was able to get the correct sequences
      27 c 48 4 Slip
      27 c 48 1 Roll
      its working now

  • @mikaa3111
    @mikaa3111 3 года назад

    Hi Is this supported for Command Apps C# DotNet Core Framework?

  • @josemanuelgomez901
    @josemanuelgomez901 3 года назад

    Does it work with Epson printers only?

    • @techsapphire
      @techsapphire  3 года назад

      Generally esc commands are common, but still I encounter where printer use diff codes.

  • @RupeshPRajan
    @RupeshPRajan 6 лет назад

    pls advise on how to get the printer path from the local system. Print method fails for me

    • @techsapphire
      @techsapphire  6 лет назад

      use this tutorial to fix local printer issue.
      ruclips.net/video/MZlLy-zhL4Y/видео.html

  • @jbamit007
    @jbamit007 3 года назад

    i am getting this error Could not load file or assembly 'PrinterUtility, Version=1.0.2.0

  • @martinmyers3169
    @martinmyers3169 2 года назад

    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?

    • @techsapphire
      @techsapphire  2 года назад

      yes it can work with network printer

  • @ibtissemsatla6086
    @ibtissemsatla6086 4 года назад

    Could i use this code on an other brand of printer rather tnan EPSON ?

    • @techsapphire
      @techsapphire  4 года назад

      For POS, code may change according to printer brand and even with model.

  • @filbertsugianto8999
    @filbertsugianto8999 6 лет назад

    I want to ask why doublewidth not working in epson tm-u220. can you give me a hint?

    • @techsapphire
      @techsapphire  6 лет назад

      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.

  • @yongchen6117
    @yongchen6117 7 лет назад

    And does this work on WPF? And how to open the cashier draw? Thanks

    • @techsapphire
      @techsapphire  7 лет назад

      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.

  • @kharulli
    @kharulli 7 лет назад

    hi. thanks for tutorial. Could you help me to set paper size? I tried to google the documentation but failed. thanks

    • @techsapphire
      @techsapphire  7 лет назад

      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,

    • @kharulli
      @kharulli 7 лет назад

      Hi Yogesh, Thanks for quick reply. Kindly send the project to kharulli@gmail.com

  • @devkpandey
    @devkpandey 7 лет назад

    Hi i am getting this error,
    PrintExtensions.Print(BytesValue, DesktopPrintApp.Properties.Settings.Default.PrinterPath);
    Error CS0029 Cannot implicitly convert type 'void' to 'byte[]'

    • @techsapphire
      @techsapphire  7 лет назад

      Send me your email ID I will ping you example code I used.

  • @yuwenpixon
    @yuwenpixon 6 лет назад

    Thank you so much for this tutorial 👍👍

    • @techsapphire
      @techsapphire  6 лет назад

      you are welcome :)

    • @yuwenpixon
      @yuwenpixon 6 лет назад

      techsapphire if i will used other brand of termal printer, can i use PrinterUtility also?

    • @techsapphire
      @techsapphire  6 лет назад +1

      Hi, all printer from all brand supporting EPSON character set are supported.

    • @yuwenpixon
      @yuwenpixon 6 лет назад

      Thanks 😊

    • @djdjjdj-lh5di
      @djdjjdj-lh5di 5 лет назад

      @@techsapphire
      Could you send the source code to me ??
      Yosef200200.yu@gmail.com

  • @binkugv
    @binkugv 6 лет назад

    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?

    • @binkugv
      @binkugv 6 лет назад

      Sorry I figured it Out add
      string eClear = ('' + "@");
      string eDrawer = (eClear + ('' + ("p" + ('\0' + ".}"))));
      BytesValue = PrintExtensions.AddBytes(BytesValue, eDrawer); after rintExtensions.AddBytes(BytesValue, CutPage());

    • @techsapphire
      @techsapphire  6 лет назад

      Glad my tutorial helped you :)

    • @rajeshraju3085
      @rajeshraju3085 6 лет назад

      please send me the full source code to rajeshraju002@gmail.com

    • @techsapphire
      @techsapphire  6 лет назад

      sent please check your email.

    • @dovantuan1592
      @dovantuan1592 6 лет назад

      Please help me open cash drawer, thank you!

  • @marcelsigolo9233
    @marcelsigolo9233 5 лет назад

    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

    • @techsapphire
      @techsapphire  5 лет назад

      Sorry I haven't worked o linux solution.

    • @marcelsigolo9233
      @marcelsigolo9233 5 лет назад

      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

  • @jbaldarr
    @jbaldarr 7 лет назад

    Hello, I would like to obtain the source code of this example, I can not find it on your site. Thanks for the Video.

  • @yaseralhousen3480
    @yaseralhousen3480 3 года назад +1

    thank you can i use it for asp core also? ...please code ?

    • @techsapphire
      @techsapphire  3 года назад +1

      share your email for code. Yes I provide commercial support for customization

    • @yaseralhousen3480
      @yaseralhousen3480 3 года назад

      @@techsapphire yaser.m.alhousen@gmail.com

    • @techsapphire
      @techsapphire  3 года назад

      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.

  • @ajijuliawan8754
    @ajijuliawan8754 Год назад

    Hi... it's a very good tutorial.. how can I get the source code? would you mind sharing it with me? Thank you

    • @techsapphire
      @techsapphire  Год назад

      Kindly mail me at yogesh.mehla@gmail.com for source code

  • @sabuj745
    @sabuj745 5 лет назад

    obj.Guilhotina.CutFull();
    this is the method for cutting page. Good video though, thanks.
    I am getting extra spaces below the barcode and can't add the text of barcode just below the barcode like it has everywhere, can you solve that?

    • @techsapphire
      @techsapphire  5 лет назад

      Hi Tiring, sorry I don't support dev queries, as for that you need to play with code. If you need commercial support, than that is separate.

  • @sbtiancz
    @sbtiancz 7 лет назад

    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.

    • @techsapphire
      @techsapphire  7 лет назад

      You can create chrome or firefox extn. Than u can print using that. Directly you can't do.

  • @MohitAggarwal8830
    @MohitAggarwal8830 4 года назад

    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 .

    • @techsapphire
      @techsapphire  4 года назад

      Can't suggest without looking into it

    • @MohitAggarwal8830
      @MohitAggarwal8830 4 года назад

      @@techsapphire Printer Utility is not support alphanumeric character in barcode. Please suggest if there is any alternative.

    • @techsapphire
      @techsapphire  4 года назад +1

      @@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();
      }

    • @MohitAggarwal8830
      @MohitAggarwal8830 4 года назад +1

      @@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.

  • @binkugv
    @binkugv 5 лет назад

    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("فاتورة ضريبية"));

    • @techsapphire
      @techsapphire  5 лет назад

      you can try something like this : var encoding = Encoding.GetEncoding(936);
      // convert the text into a byte array
      byte[] source = Encoding.Unicode.GetBytes("百順藥房");

    • @techsapphire
      @techsapphire  5 лет назад

      Or if you are using EPSON printer check my this tutorial :POS for .NET on epson printer : ruclips.net/video/5eN1Irt5ViQ/видео.html

    • @binkugv
      @binkugv 5 лет назад

      @@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

  • @emmysmith8960
    @emmysmith8960 5 лет назад

    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

    • @techsapphire
      @techsapphire  5 лет назад

      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

    • @emmysmith8960
      @emmysmith8960 5 лет назад

      @@techsapphire ok sir thank u

  • @RajKumar-qj6nl
    @RajKumar-qj6nl 6 лет назад

    Hi bro, how to connect to a epson ethernet type printer tm-t88v via c# (ip printer via c#)
    any suggestions!

    • @techsapphire
      @techsapphire  6 лет назад

      You can do by using address along with printer name.

    • @RajKumar-qj6nl
      @RajKumar-qj6nl 6 лет назад

      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.

    • @techsapphire
      @techsapphire  6 лет назад

      Sent please check your email. Second version of video is also available.
      Where you can learn to print directly from web browser. ruclips.net/video/MQMD4Pb7jzY/видео.html

  • @arturovargas1539
    @arturovargas1539 5 лет назад

    HI, how can initialize var BytesValue without GetLogo(); ??

    • @techsapphire
      @techsapphire  5 лет назад +1

      you can initialize to bytesarray.

  • @udenakajayawardane907
    @udenakajayawardane907 Год назад

    is this work only epson printers ?

  • @DanielSoares76
    @DanielSoares76 2 года назад

    Hello Mr. Yogesh, thanks for this tutorial. Can I have the source code of this one, please ?

    • @techsapphire
      @techsapphire  2 года назад +1

      Kindly share your email or mail me at yogesh.mehla@gmail.com

  • @RZM107
    @RZM107 6 лет назад

    When I print the logo, it comes out with white lines. How can i fix it.

    • @techsapphire
      @techsapphire  6 лет назад

      Don't use big image, resize it to small, also use black and white image for logo.

  • @yamasu4333
    @yamasu4333 6 лет назад

    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.

    • @techsapphire
      @techsapphire  6 лет назад

      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

    • @yamasu4333
      @yamasu4333 6 лет назад

      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
      {
      }

    • @techsapphire
      @techsapphire  6 лет назад

      mailed you code to print without temp file.

    • @yamasu4333
      @yamasu4333 6 лет назад

      Thanks Man. It Worked :)
      You'r great man!!
      I Appreciate that.

    • @yamasu4333
      @yamasu4333 6 лет назад

      One thing more, If have some Clients of this application then this code can also work for them to print receipt from their computers ??

  • @Karansidhu2190
    @Karansidhu2190 5 лет назад

    Hi, will this work for a non epson printer too?

    • @techsapphire
      @techsapphire  5 лет назад

      You can try generic printing solution. ruclips.net/video/osI7P1YdL3o/видео.html

  • @diegocastro7207
    @diegocastro7207 7 лет назад

    Hello I would like to know where I can find the package documentation, or if you can send me the video code thanks

    • @techsapphire
      @techsapphire  7 лет назад

      Send your email ID I can share code. You can re engineer code by yourself too.

  • @NaumHN
    @NaumHN 2 года назад

    Excellent video. I am new in c#.
    Can I have the source code of this one please?
    Thank You

    • @techsapphire
      @techsapphire  2 года назад

      Kindly mail me at yogesh.mehla@gmail.com for source code or leave your email in comment.

    • @kathanpatel3677
      @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;
      }
      }
      }

  • @cybertron1527
    @cybertron1527 6 лет назад

    Does this code work for all printers in the market or just epson ??

    • @techsapphire
      @techsapphire  6 лет назад

      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.

    • @cybertron1527
      @cybertron1527 6 лет назад

      thanks for the insights :)

  • @hoaxbuster518
    @hoaxbuster518 11 месяцев назад

    Hi, thanks for this. Can you please send me the source code? I stuck in printing the receipt for days now. Many thanks!

    • @techsapphire
      @techsapphire  11 месяцев назад

      Kindly mail me at yogesh.mehla@gmail.com for the code

  • @johnmurphy2643
    @johnmurphy2643 4 года назад

    Hi, I can't seem to find the link to the code, can you pls share the link?

  • @arthurgapusan
    @arthurgapusan 6 лет назад

    Hi. Im getting access to the path is denied? How to fix? Also can I use default printer

    • @techsapphire
      @techsapphire  6 лет назад

      access is denied for which path ? You need to pass printer name

    • @techsapphire
      @techsapphire  6 лет назад

      I think this link provides you solution to it ruclips.net/video/MZlLy-zhL4Y/видео.html

  • @itshappening9760
    @itshappening9760 6 лет назад

    What if we have list more than 2 items? Should we use for loop? Or..?

    • @techsapphire
      @techsapphire  6 лет назад

      yes. Their is no concept of data binding so you need loop.

    • @itshappening9760
      @itshappening9760 6 лет назад

      techsapphire and paper will automaticaly adjust height size? Also what if printer is not epson? Thanks

    • @techsapphire
      @techsapphire  6 лет назад

      yes POS printer auto increase height.

  • @bledarbregu7873
    @bledarbregu7873 3 года назад

    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

    • @techsapphire
      @techsapphire  3 года назад

      Kindly share your email

    • @techsapphire
      @techsapphire  3 года назад +2

      @@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.

  • @myDrone1
    @myDrone1 2 года назад

    Thanks for sharing. Do you have the source code for this example?

    • @techsapphire
      @techsapphire  2 года назад

      share your email or mail me at yogesh.mehla@gmail.com

  • @wimblesoft
    @wimblesoft 7 лет назад

    I need beeping hex code for a ESC/POS. I couldn't find a working one. I need help so bad.

    • @techsapphire
      @techsapphire  7 лет назад

      I can only share my solution my friend. I did it long time ago I don't have setup to try new things.

    • @wimblesoft
      @wimblesoft 7 лет назад

      techsapphire thanks anyway. I'm fucked up I think

    • @techsapphire
      @techsapphire  7 лет назад +1

      sorry man for not being more help

  • @TheHyperg
    @TheHyperg 3 года назад

    Thanks

  • @abozanona
    @abozanona 6 лет назад

    Hello, Could you please attach the code in the description?

    • @techsapphire
      @techsapphire  6 лет назад

      share your email, I will mail code to you.

  • @hasnatqureshi1188
    @hasnatqureshi1188 5 лет назад

    Mini Receipt Printer ARP-990KC I have this model thermal printer. Will this code works with that

    • @techsapphire
      @techsapphire  5 лет назад

      no Idea, you need to try

    • @hasnatqureshi1188
      @hasnatqureshi1188 5 лет назад

      @@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

    • @techsapphire
      @techsapphire  5 лет назад

      send print command 2 times. Its simple.

    • @hasnatqureshi1188
      @hasnatqureshi1188 5 лет назад

      Sir it says that temp file is used by another process. That file is not deleting by your code

    • @techsapphire
      @techsapphire  5 лет назад

      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

  • @emmysmith8960
    @emmysmith8960 5 лет назад

    Thank you sir :)

  • @mariaioannidou5964
    @mariaioannidou5964 5 лет назад

    Hello. i have a problem with QrCode. I can't pritn it. it prints ???????. can you help please?

    • @techsapphire
      @techsapphire  5 лет назад

      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.

    • @mariaioannidou5964
      @mariaioannidou5964 5 лет назад

      @@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?

    • @techsapphire
      @techsapphire  5 лет назад

      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 : ruclips.net/video/5eN1Irt5ViQ/видео.html
      Where you can learn to print directly from web browser. ruclips.net/video/MQMD4Pb7jzY/видео.html

  • @yoemrattana
    @yoemrattana 5 лет назад

    Does it support unicode font?

    • @techsapphire
      @techsapphire  5 лет назад

      Try this tutorial, if you want to different fonts ruclips.net/video/osI7P1YdL3o/видео.html

  • @VUAcademy1
    @VUAcademy1 6 месяцев назад

    Thanku for video. can you share code. will be very thankufull

    • @techsapphire
      @techsapphire  3 месяца назад

      kindly check video description.

  • @robderop376
    @robderop376 2 года назад

    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!

    • @techsapphire
      @techsapphire  2 года назад

      send mail at yogesh.mehla@gmail.com

  • @tayyabjatoi8644
    @tayyabjatoi8644 5 лет назад

    Thank you

  • @roonamii
    @roonamii 7 лет назад

    in printing did you setup the paper size sir?

    • @techsapphire
      @techsapphire  7 лет назад +1

      That depends upon your page size it varies form 30mm to 80 mm so you have to adjust spacing as per that.

    • @roonamii
      @roonamii 7 лет назад

      so when designing about the printing. I should know first what size of paper does POS printer used?

  • @moyomartin4501
    @moyomartin4501 6 лет назад

    i want to pick the items from datagridview how can i go about that? i am coding in vb.net

    • @techsapphire
      @techsapphire  6 лет назад

      code directly print text you supply. That's on you. You can supply from gridview or text box doesn't matter.

  • @girmayhadush9958
    @girmayhadush9958 Год назад

    where is the link thoa?

  • @angkorwatcambodia3671
    @angkorwatcambodia3671 2 года назад

    Thank you for the tutorial. Glad that you recommended this one to me, Can I have the source code of this one please ?

    • @techsapphire
      @techsapphire  2 года назад

      Kindly share your email please

    • @angkorwatcambodia3671
      @angkorwatcambodia3671 2 года назад

      @@techsapphire please kingly check your inbox brother.

    • @techsapphire
      @techsapphire  2 года назад

      @@angkorwatcambodia3671 Sent

    • @kathanpatel3677
      @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;
      }
      }
      }

  • @hfloresj26
    @hfloresj26 6 лет назад

    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?

    • @techsapphire
      @techsapphire  6 лет назад

      Hi Hector second version of this video is also available.
      Where you can learn to print directly from web browser. ruclips.net/video/MQMD4Pb7jzY/видео.html

    • @hfloresj26
      @hfloresj26 6 лет назад

      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?

    • @techsapphire
      @techsapphire  6 лет назад

      Sure share me your email id please

    • @hfloresj26
      @hfloresj26 6 лет назад

      hector.floresj@gmail.com

    • @techsapphire
      @techsapphire  6 лет назад

      sent please check your email

  • @shreeannasagar3710
    @shreeannasagar3710 2 года назад

    Thank you so much for the tutorial.can u please share code sir.
    Thanku 😊

    • @techsapphire
      @techsapphire  2 года назад

      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.

  • @parasu1980
    @parasu1980 10 месяцев назад

    Source code for this please

  • @krishnachaudhary5351
    @krishnachaudhary5351 6 лет назад

    All the fonts looks similar, is there a way to add our own fonts?

    • @techsapphire
      @techsapphire  6 лет назад

      for that u need to use SDK not generic text print

    • @krishnachaudhary5351
      @krishnachaudhary5351 6 лет назад

      techsapphire can you recommend any sdk? Help really appreciated

    • @techsapphire
      @techsapphire  6 лет назад

      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.

  • @shayanhasan3187
    @shayanhasan3187 Год назад

    How to save the document?

    • @techsapphire
      @techsapphire  Год назад

      you cannot save esc pos command print as preview

  • @infomaxviv7008
    @infomaxviv7008 6 лет назад

    good content

  • @senasena3423
    @senasena3423 8 месяцев назад

    hello sir, can I get the source code of this?

    • @techsapphire
      @techsapphire  8 месяцев назад

      kindly mail at yogesh.mehla@gmail.com

  • @FgroupIndonesia
    @FgroupIndonesia 4 года назад

    do you have the library out there for open sourced?

    • @FgroupIndonesia
      @FgroupIndonesia 4 года назад

      i was wondering how to connect to usb thermal printer?

    • @techsapphire
      @techsapphire  4 года назад

      yes, you can share your email. I will mail you source code used. You just need printer name to print.

    • @FgroupIndonesia
      @FgroupIndonesia 4 года назад

      @@techsapphire why dont you stored it inside github? it's more open sourced...

    • @techsapphire
      @techsapphire  4 года назад

      @@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

  • @ThiagoMartins-x6i
    @ThiagoMartins-x6i Год назад

    ty for the tutorial, can i have the source code pls?

    • @techsapphire
      @techsapphire  11 месяцев назад

      Kindly reach me at yogesh.mehla@gmail.com

  • @ttows433
    @ttows433 5 лет назад

    Where i kan find the printerutility file?
    Link please
    Thanks

    • @techsapphire
      @techsapphire  5 лет назад

      You can install printer utility using nuget packages. Or share your email ID I will mail you source code, it contains printerUtility dll.