使用Xamarin Forms Android打印到POS打印机 [英] Printing to POS Printers in Xamarin Forms Android

查看:166
本文介绍了使用Xamarin Forms Android打印到POS打印机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用XF构建的应用程序,我希望它能够通过LAN,USB甚至是WIFI发现POS打印机,并使用非常简单的模板打印收据.有人有线索吗?有这个ePOS Android SDK:

I have an app that is built with XF and I want it to be able to discover POS Printers through LAN, USB and maybe WIFI too, and print receipts with a very simple template. Does anyone have any leads ? there is this ePOS Android SDK :

https://download.epson-biz.com/modules/pos/index.php?page=prod&pcat=3&pid=36

但是与JAVA一起使用.而且我还找到了这个块状ESC-POS:

But it's with JAVA. And I also found this nugget ESC-POS :

https://github.com/lukevp/ESC-POS-.NET

如果有人对我应该如何进行或已经做过什么有任何想法,然后我真的会很感激.

If there is anyone who have any idea on how I should proceed or already done it before I would really really appreciate it.

编辑

因此,我决定使用EPSON网站上的SDK.我有2个文件.JAR

So I deicided to work with the SDK found on EPSON website. I have 2 files .JAR

  • ePOS2.jar编译的Java类文件,存档为jar格式的文件以允许API可以在Java程序中使用.

  • ePOS2.jar Compiled Java class file, archived into a jar format file to allow APIs to be used from Java programs.

ePOSEasySelect.jar一个用于轻松选择打印机的Java类文件

ePOSEasySelect.jar A Java class file for selecting a printer easily

和其他一些lib文件.so.我现在要做的就是在Xamarin应用程序中找到使用主题的正确方法.所以我发现了这个:

and some other lib files .so . All I got to do now is find the correct way to use theme in my Xamarin app. so I found this :

https://docs.microsoft.com/fr-fr/xamarin/android/platform/binding-java-library/binding-a-jar

有更多经验的人可以帮助我吗?

can anyone with further experience help me with that please ?

推荐答案

好了,我能够创建一个.dll文件并将其添加为xamarin.android项目中的引用:

Well I was able to creat a .dll file and add it as a reference in my xamarin.android project :

https://docs.microsoft.com/zh-CN/xamarin/android/platform/binding-java-library/binding-a-jar

我还必须对本线程中提到的元数据文件进行一些快速调整:

Also I had to do some quick tweaking in the metadata file as mentionned in this thread :

缺少适用于Android的Epson ePOS SDK(Xamarin)常数

这篇关于使用Xamarin Forms Android打印到POS打印机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆