Enterprise Browser Intents for PrinctConnect or PrintSetup

Hello,

I'm looking to print from Enterprise Browser via Android intents, using PrintConnect. I know this is possible, but I can't seem to find any documentation actually explaining the PrintConnect specific commands to execute this. Can anyone point me in the right direction?

Thanks!

Darryn Campbell
Hi, the PrintConnect Intent

Hi, the PrintConnect Intent interface is defined at https://www.zebra.com/content/dam/zebra_new_ia/en-us/solutions-verticals/product/Software/Printer%20Software/Link-OS/print-connect/PC-UserGuide-P1082444-001.pdf, starting on page 87.

I have never tried it but it looks like you might have problems as Enterprise Browser is only capable of sending / receiving intent extras of type String, int, bool or Double whereas the PrintConnect API has some extras which are HashMap<string, string> or byte[]

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


David Wilson
JavaScript vs Java

Hi Darryn,

Thank you for the feedback and quick response. I actually had referenced the document you linked, but all of the examples appear to only be in Java. We're running JavaScript applications in Enterprise browser, so I was hoping to execute them via JavaScript. However, your point about Enterprise Browser only being capable of sending/receiving intent of certain variable types could definitely be an issue.

I know that it is possible to initiate the intents via JavaScript because there are examples for the DataWedge application: https://techdocs.zebra.com/datawedge/6-6/guide/api/tutorials/

That being said, I haven't found examples for PrintConnect. Ideally, I'd be able to send ZPL code directly as an encoded string. I have ebapi-modules.js successfully working and am able to successfully print from EB over Bluetooth by pairing directly with the mac address. However, this isn't an optimal workflow and our warehouse would greatly prefer to just be able to pair by touching the devices and connecting with the NFC bluetooth. This would require using PrintConnect, and thus the desire for intents.

I've tried this code, but it doesn't seem to be working:

```
const zpl = `^XA
^FX Section with name.
^CF0,60
^FO90,60^FD$Header^FS
^FO0,130^GB700,1,3^FS
^FX Section with barcode.
^BY${ratio},2,170
^FO52,160^BC^FD123456^FS
^XZ`

const encoded = Buffer.from(zpl, "utf-8");

var params = {
intentType: EB.Intent.BROADCAST,
action: "com.zebra.printconnect.print.PassthroughService",
appName: "com.zebra.printconnect",
data: { "com.zebra.printconnect.PrintService.PASSTHROUGH_DATA": encoded },
};

EB.Intent.send(params);
```

I've also added intents to the Config.xml file, but still no luck. We may just have to use a custom solution and connect via mac address for the time being.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Darryn Campbell
I was going to suggest using

I was going to suggest using something like Device Central (https://techdocs.zebra.com/devicecentral/3-0/guide/about/) to pre-pair the printer but it looks like EB needs to handle the pairing process itself so that seems to be a non-starter.

If it were me, I would write a little simple native program that you could call via EB Intents and that program could translate the commands into Intents that PrintConnect would understand, but I appreciate that is a long winded solution.

Incidentally, there is a sample app with source code called Test Connect that is included in the platform SDK, according to https://www.zebra.com/us/en/support-downloads/printer-software/by-request-software.html

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


Log in to post comments