In this video, we will be learning how to print a receipt to a POS network printer from Xamarin forms iOS, Android and UWP application. 1. Background Music Link • TIK TOK No Copyright M...
КОМЕНТАРІ: 85
@carljohnlopez54252 роки тому
great video , this helps me alot , how do you format or put qr code in the output sir? do you have source code of font format and qr code ?
@najeebvannp2 роки тому
Can I use the same method Print() for printing an image instead of IList
@zackcoolman13 роки тому
How do i print image? print text has no problem on my app
@redinversati39242 роки тому
great!. How can i print pdf, or bitmap, or canvas image usign this socket connetion?
@kratos7ism2 роки тому
Thank you so much bro . Your code works perfect . Although i have no problems printing or connecting to a printer it seems that when i use a A4 paper every word you pass as parameters is printed diagonally. Is there any way to fix that ??
@vivekhariharganj3 роки тому
Thanks For Showing example. Please help me to print xamarin page , or if I have list of product object
@wlickez2 роки тому
Thanks for this tuto, why do you use the 9100 port?
Glad you like it. Please share this content so others find it useful too. Thanks.
@diegoliterat85233 роки тому
Hi, i have question. how i can to get my IP address of my printer in the code? you set this in string, but if i need implement in App i need to get the IP Address.
@user-yq8ow5uz2eРік тому
Thanks alot
@janakipriya7204Рік тому
hi i made webview i want to print that using android print manager on print preview page the webview contains white border at all place how to remove
@kratos7ism2 роки тому
Is there any way to support printing International characters like Greek or Arabic?? English works fine but international characters are printed out like weird symbols.
@skyfiprog72002 роки тому
I need to try this, this kind of video is a big help for me, how to pay you if i need help
@chickenpoxtv32874 роки тому
Thank you
@MrNawshad4 роки тому
I m glad you liked it.
@chickenpoxtv32874 роки тому
Can I have a question .. I'm using xamarin in Visual Studio windows version.. I got error using assembly : dependency above in the namespace and dependencyservice ? Can u make a tutorial?
@MrNawshad3 роки тому
@@chickenpoxtv3287 could you be more specific about the error you are encountering. Thanks.
@chickenpoxtv32873 роки тому
@@MrNawshad this code is use to all POS printer brand?
@MrNawshad3 роки тому
@@chickenpoxtv3287 yeah. As long as the printer supports ESC/POS commands. Which majority of the printer providers support.
@mohsenmohamed22813 роки тому
Why you made a class in each platform with the same implementation ? Why you didn't make just one class at the shared project and call the print() function from the button ?
@MrNawshad2 роки тому
to show the use of dependency service. You could use the same code on the shared project and that would work the same way. Thanks
@wahyuadhilaksana64572 роки тому
Can I using Printer Brother DCP-T420W , Sir ? thank you
@MrNawshad2 роки тому
yes, as long as its connected to your local network.
@venuqsconsultants31382 роки тому
when connecting to psocket.connect it is showing mistake "operation blocked "
@GianAlmeydaРік тому
good contribution, it works for me, but I have problems cutting the paper, can you help me?
@MrNawshadРік тому
for full cut send this command { 0x1d, 0x56, 0x00 }; // Full cut paper
@GianAlmeydaРік тому
@@MrNawshad How do I apply it after outputList.Add(0x1d); outputList.Add(0x56); outputList.Add(0x00);
@GianAlmeydaРік тому
@@MrNawshad Thanks, I was able to apply it, I was getting complicated, pSocket.Send(outputList.ToArray()); pSocket.Send(PrinterCommands.CUT_PAPER);
@mraak3243 роки тому
I have done this using Bluetooth connectivity print is genrate but issue is half print coming first time then next time I am giving aging print comnad then last print half portion coming in current print Can you suggest me what I have to do for resolving the issue?
@MrNawshad3 роки тому
It is a bit difficult to suggest something without looking at your code.
@mraak3243 роки тому
@@MrNawshad public async Task Print(string deviceName, IList linesToPrint) { using (BluetoothAdapter bluetoothAdapter = BluetoothAdapter.DefaultAdapter) { BluetoothDevice device = (from bd in bluetoothAdapter?.BondedDevices where bd?.Name == deviceName select bd).FirstOrDefault(); try { using (BluetoothSocket bluetoothSocket = device?. CreateRfcommSocketToServiceRecord( UUID.FromString("00001101-0000-1000-8000-00805f9b34fb"))) { List outputList = new List(); foreach (string txt in linesToPrint) { // Convert the strings to list of bytes outputList.AddRange(System.Text.Encoding.UTF8.GetBytes(txt)); // Add ECS/POS Print and line feed command outputList.Add(0x0A); ; } bluetoothSocket?.Connect(); if (bluetoothSocket.IsConnected) { Thread.Sleep(200); try { bluetoothSocket.OutputStream.Write(outputList.ToArray()); } catch (Exception e) { } //bluetoothSocket.OutputStream.Position = 0; //System.Threading.Thread.Sleep(5000); bluetoothSocket.OutputStream.Flush(); bluetoothSocket.OutputStream.Close(); bluetoothSocket.OutputStream.Dispose(); // bluetoothSocket.OutputStream.Position =0; bluetoothSocket.Close(); bluetoothSocket.Dispose(); } } } catch (Exception exp) { throw exp; } } }
@MrNawshad3 роки тому
@@mraak324 use try catch finally for instance try { }catch { }finally{ bluetoothSocket.OutputStream.Flush(); bluetoothSocket.OutputStream.Close(); bluetoothSocket.OutputStream.Dispose(); // bluetoothSocket.OutputStream.Position =0; bluetoothSocket.Close(); bluetoothSocket.Dispose(); } see if this works. good luck. and let me know your result. thanks.
@mraak3243 роки тому
@@MrNawshad hi Issue has been resolved I have update my printer firmware now print is coming perfectly Thank for your quick support Can we print pdf using above code ?
@By_Bestboy9 місяців тому
Hi. Could you please tell me how you obtain a bluetoothsocket in IOS?. Thank you.
@mestutosisptheophile89912 роки тому
Can i use the same code to print on an handheld android terminal ????
@MrNawshad2 роки тому
you need to connect to the device first, the printing commands are same for any devices. thanks.
@mestutosisptheophile89912 роки тому
@@MrNawshad my terminal have an incorated printer so when i try your code i have the message connection refused.
@mestutosisptheophile89912 роки тому
@@MrNawshad my android terminal has an incorporated printer but when i try your code by specifiying the ip adress and the port i get : connection refused, please what can i do ???
@MrNawshad2 роки тому
@@mestutosisptheophile8991 I guess your terminal printer does not have an associated ip address, the ip address you are targeting is for the terminal itself. I think you have to print to this printer through USB communication. if you look into the terminal's manual they usually proved with printer sample code. thanks.
@mestutosisptheophile89912 роки тому
@@MrNawshad i see the manual of the terminal it written android bluetooth terminal, when i activate bluetooth i see the printer name among connected devices, what can i do so ? thank you.
@AMIRKHAN-dm2fm3 роки тому
How to generate Collection View data in to PDF File in Xamarin.forms can u please make tutorial?
@MrNawshad3 роки тому
Didn’t get what you are asking for.
@AMIRKHAN-dm2fm3 роки тому
@@MrNawshad OK let me explain I want create PDF file of my listview data items like receipt.
@MrNawshad3 роки тому
And where would you like to save it?
@AMIRKHAN-dm2fm3 роки тому
@@MrNawshad I want to save it on my mobile device or send mail
@MrNawshad3 роки тому
Ok. I understand now. Can’t promise on doing a video on it anytime sooner. But will definitely do it once I have my current projects sorted first.
@AMIRKHAN-dm2fm3 роки тому
hi please tell me ho to save web view data as pdf ?
@MrNawshad3 роки тому
codemilltech.com/xamarin-forms-e-z-print/
@AMIRKHAN-dm2fm3 роки тому
@@MrNawshad I think this document is supported with older version of Xamarin. Can you please make a tutorial of how to print HTML Page with WebView.
@AMIRKHAN-dm2fm3 роки тому
if you do that this is really helpful for me because my whole project is stuck on it. I have tried a lot of things but useless.
@ramanprajapati52662 роки тому
Its not working.Can you update
@MrRobravens2 роки тому
Bit useless using dependency service for this when the implementation is the same
@balajidj61843 роки тому
How to print from Android?
@MrNawshad2 роки тому
implement the printer class on android and call the print method from the button event click handler.
@jooskesters94723 роки тому
I followed this guide and my printer is not printing anything :/
@MrNawshad3 роки тому
Make sure you target the right IP address of your printer.
@jooskesters94723 роки тому
@@MrNawshad I connected the printer to my network. Got the ip printed out. Pinged the ip with my laptop to make sure. Than ran my app and tried to print.. Nothing comes out. Do I need certain drivers installed for this on my laptop or sth ?
@MrNawshad3 роки тому
You need to configure the printer on your network.
@jooskesters94723 роки тому
@@MrNawshad Do you have discord where I can ask you some questions during my troubleshooting ? I understand your response as going to my router page and look for the printer in the settins over there ?
@jooskesters94723 роки тому
In the mean time. I just went to the configuration page of the printer. Logged in, and made sure the settings were right. To sum it up. Network mode: infrastructure mode, 9100 Multi session (tried enable and disable) both don't make a difference for making it work.