我正在尝试使用Scandit sdk或插件扫描条形码。如何在ionic2中的.ts文件中导入scandit插件 我的代码是
def SendMail(request,scan_id):
pdf_s = request.GET.get('pdf_data')
print(pdf_s)
fo = open('test.pdf','w')
fo.write(pdf_s)
fo.close()
html_content = "Test Message"
email = EmailMessage("test", html_content, "test", ["test@test.com"])
email.content_subtype = "html"
fd = open('test.pdf', 'r')
email.attach('test', fd.read(), 'application/pdf')
res = email.send()
if res:
status = 'Success'
else:
status = 'Fail'
return HttpResponse(status)
我根据此链接编写此代码 - http://krishjan.com/2016/10/27/multiple-barcode-scanning-in-ioniccordova-using-scandit-api/
但它不起作用。如何使用scandit插件扫描条形码。
感谢您的回答。
答案 0 :(得分:1)
我通过将插件导入.ts文件来解决我的问题,就像这样
import { Scanditsdk } from plugins/com.mirasense.scanditsdk.plugin/plugin.xml
然后它完美无缺。