Print Examples and Code Snippets
Looking for a way to test different print methods? Below are examples and use case scenarios.
iOS
Sample Apple iOS Mobile Print
- Print to Stored Format
- Print Via Encoded URL
- Print with Encoded CPCL
- Print Encoded PDF (1-click Print)
- Print PDF from URL
- Mobi Print Extension for iOS
- Mobi Print Android Intent
- Print via URL and show Branded Logo Splash Page
- Print & Return to Another App
This method is most commonly used when the format is relatively set and variable data is imported to the same place and around the same size every time. Many users utilize this method from web apps and FileMaker solutions.
Example Syntax:
arrowhead://x-callback-url/print?v1=VARIBALE1&selected_format=filename.extension
In this sample, the child's name, classroom, age, and time are the variables. By entering data in the URL, you can print this format for every kid in the classroom.
Test Stored Format
This method is most commonly used for users that know their ZPL ahead of time. You can create a label from Zebra Designer then base64 encode the prn file contents to get the code portion of your string. Once you do so, you can print with 1-Click to Mobi Print.
Example Syntax:
arrowhead://x-callback-url/cpclcode?code=[code]
This method is most commonly used for users that know their CPCL ahead of time. You can create a label from Zebra Designer then base64 encode the prn file contents to get the code portion of your string. Once you do so, you can print with 1-Click to Mobi Print. Example Syntax:
arrowhead://x-callback-url/cpclcode?code=[code]
This method is most commonly used for users wanting the 1-Click print and don't have internet access. Our FileMaker partner, Collibri, uses this method to make a mobile invoice printing solution then base64 encode the PDF within their FileMaker solution then creates a button for a 1-Click to Mobi Print.
Example Syntax:
arrowhead://x-callback-url/printencodedpdf?base64=
This method is most commonly used for users wanting the 1-Click print and have internet access. Our have users doing ticketing and online invoicing that host their PDF on their website then send the URL of the PDF to Mobi Print for printing.
Example Syntax:
arrowhead://x-callback-url/printpdf?file=[URLofPDF]
These feature was released when iOS 8 allowed interapp data sharing. We can now take a PDF, HTML, ZPL code, CPCL code, or an image. It takes the settings designated in the Mobi Print app and prints with the reszing page options previously selected.
From another iOS app that has the Share icon enabled, you can select "Print with Mobi Print" and send the print job straight to Mobi Print.
Test Link
Once on Safari page, hit the Share icon and Print with Mobi Print.
This feature was made to pair with any of our URL methods above & give our users some control over the print process.
When a user enters their logo URL in the Settings page then they can access a screen in Mobi Print when a print job occurs that shows just their logo & the status of the print then returns them to their application upon completion to allow more visibility in the print process/
Example Syntax:
arrowhead://x-callback-url/printencodedpdf?Splash=true&x-success=fmp://&base64=[pdfcode]
example to return to google.com on sucessful print
arrowhead://x-callback-url/zplcode?x-success=
arrowhead://x-callback-url/zplcode?x-success=http://google.com&code=
Android
Sample Android OS Mobile Print Examples
- Print to Stored Format
- Print Via Encoded URL
- Print with Encoded CPCL
- Print Encoded PDF (1-click Print)
- Print PDF from URL
- Mobi Print Android Intent
- Print via URL and show Branded Logo Splash Page
This method is most commonly used when the format is relatively set and variable data is imported to the same place and around the same size every time. Many users utilize this method from web apps and FileMaker solutions.
Example Syntax:
arrowhead://x-callback-url/print?v1=VARIBALE1&selected_format=filename.extension
In this sample, the child's name, classroom, age, and time are the variables. By entering data in the URL, you can print this format for every kid in the classroom.
Test Stored Format
This method is most commonly used for users that know their ZPL ahead of time. You can create a label from Zebra Designer then base64 encode the prn file contents to get the code portion of your string. Once you do so, you can print with 1-Click to Mobi Print.
Example Syntax:
arrowhead://x-callback-url/cpclcode?code=[code]
This method is most commonly used for users that know their CPCL ahead of time. You can create a label from Zebra Designer then base64 encode the prn file contents to get the code portion of your string. Once you do so, you can print with 1-Click to Mobi Print. Example Syntax:
arrowhead://x-callback-url/zplcode?code=[code]
This method is most commonly used for users wanting the 1-Click print and don't have internet access. Our FileMaker partner, Collibri, uses this method to make a mobile invoice printing solution then base64 encode the PDF within their FileMaker solution then creates a button for a 1-Click to Mobi Print.
Example Syntax:
arrowhead://x-callback-url/printencodedpdf?base64=
This method is most commonly used for users wanting the 1-Click print and have internet access. Our have users doing ticketing and online invoicing that host their PDF on their website then send the URL of the PDF to Mobi Print for printing.
Example Syntax:
arrowhead://x-callback-url/printpdf?file=[URLofPDF]
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.arrowhead.mobiprintpro.android",
"com.arrowhead.mobiprintpro.android.ActivitySend");
intent.putExtra("isHTML", true);
intent.putExtra("htmlURL", fileURL);
intent.setType("application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
startActivity(intent);
This feature was made to pair with any of our URL methods above & give our users some control over the print process.
When a user enters their logo URL in the Settings page then they can access a screen in Mobi Print when a print job occurs that shows just their logo & the status of the print then returns them to their application upon completion to allow more visibility in the print process/