2017-01-29 1 views
-1
  1. Existe-t-il un moyen d'utiliser le SDK Zebra avec une autre imprimante?
  2. Existe-t-il un moyen d'envoyer cette sortie à l'imprimante BlueTooth?

Voici un code très simple:L'envoi d'un code-barres/QRcode généré par ZXING à une imprimante Bluetooth

MainActivity.cs:

using System; 
using Android.App; 
using Android.Content; 
using Android.Runtime; 
using Android.Views; 
using Android.Widget; 
using Android.OS; 
using Android.Graphics; 
using ZXing; 

namespace QR_Code_Scanner 
{ 
[Activity(Label = "QR_Code_Scanner", MainLauncher = true, Icon = 
"@drawable/icon")] 
public class MainActivity : Activity 
{ 

    protected override void OnCreate(Bundle bundle) 
    { 
     base.OnCreate(bundle); 

     // Set our view from the "main" layout resource 
     SetContentView(Resource.Layout.Main); 

     // Get our button from the layout resource, 
     // and attach an event to it 
     ImageView view = FindViewById<ImageView> (Resource.Id.qrCodeView); 
     Button scannerButton = FindViewById<Button> 
(Resource.Id.scannerButton); 
     view.SetImageBitmap (GetQRCode()); 

     scannerButton.Click += async (sender, e) => { 
      var scanner = new ZXing.Mobile.MobileBarcodeScanner(this); 
      var result = await scanner.Scan(); 

      //Console.WriteLine(result.Text); 
      Toast.MakeText(this, result.Text, ToastLength.Long).Show(); 


     }; 
    } 

    private Bitmap GetQRCode() 
    { 
     var writer = new BarcodeWriter 
     { 
      Format = BarcodeFormat.QR_CODE, 
      Options = new ZXing.Common.EncodingOptions 
      { 
       Height = 600, 
       Width = 600 
      } 
     }; 
     return writer.Write ("LEC-15 8320"); 
    } 
} 
} 
+0

Bienvenue sur Stack Overflow ! Veuillez parcourir le [tour] (http://stackoverflow.com/tour), le [centre d'aide] (http://stackoverflow.com/help) et le [comment poser une bonne question] (http: // stackoverflow.com/help/how-to-ask) sections pour voir comment ce site fonctionne et pour vous aider à améliorer vos questions actuelles et futures, ce qui peut vous aider à obtenir de meilleures réponses. –

Répondre

0

Je pense que vous pouvez jeter un oeil à ces documents

Cross platform app development for printing Je n'ai jamais utilisé ce SDK (c'est très jeune).

Habituellement, vous pouvez utiliser directement la commande de l'imprimante. Je ne me souviens pas quelle commande langues utilisent Zebra, je pense qu'ils utilisent ESC/PL ou ZPL

ZPL programming guide

Par exemple, dans ZPL Je pense que vous devriez envoyer^BC pour une Code128