---
title: "Print from a website with PosPrinterDriver"
description: "Android links to open PosPrinterDriver from a website and send text or a file to print."
canonical: "https://www.posprinterdriver.com/en-printfromweb"
date_modified: "2026-09-14"
language: "en"
---

# 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.

## 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](printfromweb://print/Test%20from%20web%24intro%24)

- 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 5
const 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.

## Behaviour depends on the browser

> Chrome, WebView and other browser policies can change. Test the Android and browser versions your installation will actually use and always provide a clear alternative.
