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

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ธ.ค. 2024

ความคิดเห็น •

  • @SuperWolffighter
    @SuperWolffighter 7 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      Sorry for late reply. Glad you found your fix.

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

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

  • @alevak09
    @alevak09 4 ปีที่แล้ว

    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  4 ปีที่แล้ว

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

    • @alevak09
      @alevak09 4 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  4 ปีที่แล้ว

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

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

  • @jjvm
    @jjvm 5 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

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

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

  • @arneskillz5170
    @arneskillz5170 7 ปีที่แล้ว +2

    Is this only for Epson Printer

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

  • @mohammedsouban7112
    @mohammedsouban7112 4 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  4 ปีที่แล้ว

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

  • @elvingonzalez8932
    @elvingonzalez8932 2 ปีที่แล้ว +1

    hello, where do we find the library please

    • @techsapphire
      @techsapphire  2 ปีที่แล้ว

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

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

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

  • @CaptainHarmonyLMAO
    @CaptainHarmonyLMAO 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 th-cam.com/video/5eN1Irt5ViQ/w-d-xo.html

  • @mikaa3111
    @mikaa3111 3 ปีที่แล้ว

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

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

  • @ibtissemsatla6086
    @ibtissemsatla6086 5 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

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

  • @sameersingh4802
    @sameersingh4802 5 ปีที่แล้ว

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

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

  • @udenakajayawardane907
    @udenakajayawardane907 ปีที่แล้ว

    is this work only epson printers ?

  • @s3t14d4rm4
    @s3t14d4rm4 6 ปีที่แล้ว

    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  6 ปีที่แล้ว

      try this video th-cam.com/video/MZlLy-zhL4Y/w-d-xo.html

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

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

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

  • @Karansidhu2190
    @Karansidhu2190 5 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

      You can try generic printing solution. th-cam.com/video/osI7P1YdL3o/w-d-xo.html

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

  • @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 th-cam.com/video/MZlLy-zhL4Y/w-d-xo.html

  • @yoemrattana
    @yoemrattana 5 ปีที่แล้ว

    Does it support unicode font?

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

      Try this tutorial, if you want to different fonts th-cam.com/video/osI7P1YdL3o/w-d-xo.html

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

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

  • @hasnatqureshi1188
    @hasnatqureshi1188 6 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  6 ปีที่แล้ว

      no Idea, you need to try

    • @hasnatqureshi1188
      @hasnatqureshi1188 6 ปีที่แล้ว

      @@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  6 ปีที่แล้ว

      send print command 2 times. Its simple.

    • @hasnatqureshi1188
      @hasnatqureshi1188 6 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  6 ปีที่แล้ว

      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

  • @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. th-cam.com/video/MQMD4Pb7jzY/w-d-xo.html

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

  • @Nirgaya
    @Nirgaya 6 ปีที่แล้ว

    Superb Effort. Nicely done...

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

  • @amzaropanget
    @amzaropanget 7 หลายเดือนก่อน

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

  • @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 : th-cam.com/video/5eN1Irt5ViQ/w-d-xo.html

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

  • @Faracus
    @Faracus 7 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      It is there Faracus in code.

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

  • @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. th-cam.com/video/tYDezxaoNaQ/w-d-xo.html

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

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

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

  • @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. th-cam.com/video/osI7P1YdL3o/w-d-xo.html

    • @kathanpatel3677
      @kathanpatel3677 ปีที่แล้ว

      wroking all printer

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

  • @dovantuan1592
    @dovantuan1592 7 ปีที่แล้ว

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

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

  • @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.
      th-cam.com/video/MZlLy-zhL4Y/w-d-xo.html

  • @marcelsigolo9233
    @marcelsigolo9233 6 ปีที่แล้ว

    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  6 ปีที่แล้ว

      Sorry I haven't worked o linux solution.

    • @marcelsigolo9233
      @marcelsigolo9233 6 ปีที่แล้ว

      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

  • @cybertron1527
    @cybertron1527 7 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      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 7 ปีที่แล้ว

      thanks for the insights :)

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

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

  • @mariaioannidou5964
    @mariaioannidou5964 6 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  6 ปีที่แล้ว

      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 6 ปีที่แล้ว

      @@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  6 ปีที่แล้ว

      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 : th-cam.com/video/5eN1Irt5ViQ/w-d-xo.html
      Where you can learn to print directly from web browser. th-cam.com/video/MQMD4Pb7jzY/w-d-xo.html

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

  • @mishraup
    @mishraup 5 ปีที่แล้ว

    Tharmal printer recept process?????

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

      please elaborate, unable to get your point.

    • @mishraup
      @mishraup 5 ปีที่แล้ว

      Sir plz send me this project
      ambrishmishra.tz@gmail.com

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

      Sent please check your email. Second version of video is also available.
      Where you can learn print using POS for .NET on epson printer : th-cam.com/video/5eN1Irt5ViQ/w-d-xo.html
      Where you can learn to print directly from web browser. th-cam.com/video/MQMD4Pb7jzY/w-d-xo.html

  • @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. th-cam.com/video/MQMD4Pb7jzY/w-d-xo.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

  • @SuperWolffighter
    @SuperWolffighter 7 ปีที่แล้ว

    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

  • @binkugv
    @binkugv 6 ปีที่แล้ว

    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  6 ปีที่แล้ว

      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  6 ปีที่แล้ว

      Or if you are using EPSON printer check my this tutorial :POS for .NET on epson printer : th-cam.com/video/5eN1Irt5ViQ/w-d-xo.html

    • @binkugv
      @binkugv 6 ปีที่แล้ว

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

  • @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 th-cam.com/video/MZlLy-zhL4Y/w-d-xo.html

  • @mohamedel-zohary7948
    @mohamedel-zohary7948 5 ปีที่แล้ว

    is this code can work on sprt sp-pos88v ?

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

      You can test, if it doesn't work you can try print document.

  • @arturovargas1539
    @arturovargas1539 6 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  6 ปีที่แล้ว +1

      you can initialize to bytesarray.

  • @yongchen6117
    @yongchen6117 7 ปีที่แล้ว

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

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

  • @salahthabet6690
    @salahthabet6690 7 ปีที่แล้ว

    Does it support the Arabic characters ?

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      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 );

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      try with this Encoding.GetEncoding("windows-1256")

    • @salahthabet6690
      @salahthabet6690 7 ปีที่แล้ว

      Thank you for your reply, i will try it.

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

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

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

  • @sumeetpatel6844
    @sumeetpatel6844 6 ปีที่แล้ว

    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  6 ปีที่แล้ว

      sent you mail

    • @sumeetpatel6844
      @sumeetpatel6844 6 ปีที่แล้ว

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

  • @jbamit007
    @jbamit007 4 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  4 ปีที่แล้ว

      kindly check shared source code

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

  • @johnmurphy2643
    @johnmurphy2643 4 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  4 ปีที่แล้ว

      Kindly share your email.

    • @johnmurphy2643
      @johnmurphy2643 4 ปีที่แล้ว

      @@techsapphire dev.notify5@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.

  • @binkugv
    @binkugv 7 ปีที่แล้ว

    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 7 ปีที่แล้ว

      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  7 ปีที่แล้ว

      Glad my tutorial helped you :)

    • @rajeshraju3085
      @rajeshraju3085 7 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      sent please check your email.

    • @dovantuan1592
      @dovantuan1592 7 ปีที่แล้ว

      Please help me open cash drawer, thank you!

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

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

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      Please share your email id

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

  • @sabuj745
    @sabuj745 6 ปีที่แล้ว

    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  6 ปีที่แล้ว

      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.

  • @fabiolira5806
    @fabiolira5806 5 ปีที่แล้ว

    How to print in asp.net mvc side client?

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

      Please check this solution, this will help you th-cam.com/video/MQMD4Pb7jzY/w-d-xo.html

  • @sharjeelkhan9734
    @sharjeelkhan9734 7 ปีที่แล้ว

    how to check printer availability?

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      Sorry I don't have sample code for that. You need to google it ourself.

    • @sharjeelkhan9734
      @sharjeelkhan9734 7 ปีที่แล้ว

      thanku bro please email me this code b013.052@gmail.com

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว +1

      sent please check your email.

    • @sharjeelkhan9734
      @sharjeelkhan9734 7 ปีที่แล้ว

      Thanku so much :)

  • @manishgoswami3455
    @manishgoswami3455 7 ปีที่แล้ว

    Hi.. I am getting error while printing alphanumeric character in barcode

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      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.

    • @manishgoswami3455
      @manishgoswami3455 7 ปีที่แล้ว

      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

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      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.

    • @manishgoswami3455
      @manishgoswami3455 7 ปีที่แล้ว

      techsapphire hi.. Is it possible to build in lower version of. Net framework. It's not working in 2.0

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      can't say. You can decompile library with jetbrains and try to compile it again with 2.0 framework. And see if that works.

  • @malikarslan5638
    @malikarslan5638 5 ปีที่แล้ว

    i have to print receipt on thermal printer for a pharmacy. kindly send me this code plz

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

      please share your email id

    • @malikarslan5638
      @malikarslan5638 5 ปีที่แล้ว

      @@techsapphire malikarslan160572@gmail.com

    • @malikarslan5638
      @malikarslan5638 5 ปีที่แล้ว

      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.

    • @techsapphire
      @techsapphire  5 ปีที่แล้ว

      I have mailed you code. Please customize as per you need. I provide commercial support if needed.

    • @johnibasha6765
      @johnibasha6765 5 ปีที่แล้ว

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

  • @samuelreyeslara5248
    @samuelreyeslara5248 7 ปีที่แล้ว

    Hello, its posible to get that code?

  • @abozanona
    @abozanona 7 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      share your email, I will mail code to you.

  • @johnyor84
    @johnyor84 7 ปีที่แล้ว

    May I ask you for code or example ? thank you

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      Please share your email id

    • @johnyor84
      @johnyor84 7 ปีที่แล้ว

      techsapphire johnyor@gmail.com

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      sent please check your email inbox

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

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

  • @haroldhong8645
    @haroldhong8645 6 ปีที่แล้ว

    hello sir, can I use this in vb.net?

    • @techsapphire
      @techsapphire  6 ปีที่แล้ว

      yes you can use any .net supported language

  • @thewilkinsons2010
    @thewilkinsons2010 6 ปีที่แล้ว

    I am having some issues also. May I get the sourcecode?

    • @thewilkinsons2010
      @thewilkinsons2010 6 ปีที่แล้ว

      jkwilkinson99@juno.com

    • @techsapphire
      @techsapphire  6 ปีที่แล้ว

      Sent please check your email. Second version of video is also available.
      Where you can learn print using POS for .NET on epson printer : th-cam.com/video/5eN1Irt5ViQ/w-d-xo.html
      Where you can learn to print directly from web browser. th-cam.com/video/MQMD4Pb7jzY/w-d-xo.html

  • @shayanhasan3187
    @shayanhasan3187 2 ปีที่แล้ว

    How to save the document?

    • @techsapphire
      @techsapphire  2 ปีที่แล้ว

      you cannot save esc pos command print as preview

  • @NaumHN
    @NaumHN 3 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  3 ปีที่แล้ว

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

  • @shreeannasagar3710
    @shreeannasagar3710 3 ปีที่แล้ว

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

    • @techsapphire
      @techsapphire  3 ปีที่แล้ว

      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.

  • @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. th-cam.com/video/5eN1Irt5ViQ/w-d-xo.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:
      th-cam.com/video/3IcJWpw6wL8/w-d-xo.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: th-cam.com/video/osI7P1YdL3o/w-d-xo.html

  • @pavankumargopa
    @pavankumargopa 5 ปีที่แล้ว

    Can you share the project code that is available in Video?

  • @VUAcademy1
    @VUAcademy1 8 หลายเดือนก่อน

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

    • @techsapphire
      @techsapphire  6 หลายเดือนก่อน

      kindly check video description.

  • @ttows433
    @ttows433 6 ปีที่แล้ว

    Where i kan find the printerutility file?
    Link please
    Thanks

    • @techsapphire
      @techsapphire  6 ปีที่แล้ว

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

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

  • @manikantareddy8651
    @manikantareddy8651 7 ปีที่แล้ว

    Hiii,I want print format as text boxes usng c#...can anyone will help me,its urgent...thanks

    • @techsapphire
      @techsapphire  7 ปีที่แล้ว

      formatting is not fixed you have to hit and try as it depend upon page size supported by printer.

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

  • @atliensen
    @atliensen 4 ปีที่แล้ว

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