Web integration

Open PosPrinterDriver from a link on your website.

Your page builds an explicit URL that Android passes to the installed app. The browser and user remain in control of opening it.

Updated:

Print text from a button

Open this page on Android with PosPrinterDriver installed and printer number 1 configured. Select the button to print “Web print test”.

html
<a href="printfromweb://print/Test%20from%20web%24intro%24"> Print test</a>

Print test

  • The button opens the app and sends the text directly to printer number 1, without preview.
  • If Android asks which app should open the link, select PosPrinterDriver. Use the page button; pasting the address into a search box may start a search instead.

Prepare your own ticket

Encode the text with encodeURIComponent and assign the URL to a link the user can select.

javascript
const ticket = 'Order #123$intro$Total: 12,50 €$intro$';document.getElementById('imprimir-ticket').href = 'printfromweb://print/' + encodeURIComponent(ticket);
  • Create a link on your page with id="imprimir-ticket" and the label “Print ticket”.
  • com.fidelier.printfromweb:// followed by the encoded text is also supported, without adding ?data=.
  • $intro$ adds a line break. This flow does not select other printers through parameters.

Link to a file

path must be a URL accessible to the device and must be encoded.

javascript
const fileUrl = 'https://example.com/ticket.png';const printer = 2; // from 1 to 5const direct = 1;const url = 'com.fidelier.printfilefromweb://?path=' + encodeURIComponent(fileUrl) + '&pn=' + printer + '&direct=' + direct;window.location.href = url;
  • pn selects printers 1 to 5 in this file flow.
  • direct=1 requests direct printing; otherwise a preview may be shown.
  • The file URL must not require a session that the app cannot use.

Conditions your website must handle

App installed

If Android does not recognise the scheme, provide a visible Google Play link and retain the ticket for another attempt.

User action

Open the link from a button or gesture. Browsers may block automatic launches.

Encoded content

Use encodeURIComponent for line breaks, symbols, accents and the file URL.

Secure origin

Serve your website and files over HTTPS. Do not include credentials or sensitive data in a public URL.