0 Replies Latest reply on Aug 24, 2018 4:43 AM by Arnold Joseph Ballesteros

    Image file location on Print Connect

    Arnold Joseph Ballesteros

      ON THE GRAPHIC print sample code below from Print connect user guide page 98 , where is the ZebraLogo.jpg  file located ?  Is the file real on the app or just a sample, if just a sample then where is the default location for images?  Is it the same location as the Template folder?

       

       

      Button graphicPrint = (Button) findViewById(R.id.graphicPrint);

      graphicPrint.setOnClickListener(new View.OnClickListener() {

      @Override

      public void onClick(View v) {

      Intent intent = new Intent();

      intent.setComponent(new ComponentName("com.zebra.printconnect",

      "com.zebra.printconnect.print.GraphicPrintService"));

      intent.putExtra("com.zebra.printconnect.PrintService.GRAPHIC_FILE_NAME", "ZebraLogo.jpg");

      // Image rotation in degrees (0, 90, 180, 270)

      intent.putExtra("com.zebra.printconnect.PrintService.GRAPHIC_FILE_ROTATION", 180);

      // Image margin top in dots

      intent.putExtra("com.zebra.printconnect.PrintService.GRAPHIC_FILE_MARGIN_TOP", 10);

      // Image margin left in dots

      intent.putExtra("com.zebra.printconnect.PrintService.GRAPHIC_FILE_MARGIN_LEFT", 0);

      // Image margin bottom in dots

      intent.putExtra("com.zebra.printconnect.PrintService.GRAPHIC_FILE_MARGIN_BOTTOM", 10);

      // Center image horizontally (default is false)

      intent.putExtra("com.zebra.printconnect.PrintService.GRAPHIC_FILE_CENTER", true);

      // Image horizontal scaling amount in percentage points (5-300)

      intent.putExtra("com.zebra.printconnect.PrintService.GRAPHIC_FILE_SCALE_X", 25);

      // Image vertical scaling amount in percentage points (5-300)

      intent.putExtra("com.zebra.printconnect.PrintService.GRAPHIC_FILE_SCALE_Y", 25);

      intent.putExtra("com.zebra.printconnect.PrintService.RESULT_RECEIVER", buildIPCSafeReceiver(new

      ResultReceiver(null) {

      @Override

      protected void onReceiveResult(int resultCode, Bundle resultData) {

      if (resultCode == 0) { // Result code 0 indicates success

      // Handle successful print

      } else {

      // Handle unsuccessful print

      // Error message (null on successful print)

      String errorMessage = resultData.getString("com.zebra.printconnect.PrintService.ERROR_MESSAGE");

      }

      }

      }));

      startService(intent);

      }

      });