Designer & tools
Examples
The runnable examples inside the Playground, covering every content type and integration style.
Last updated
PrintLink embeds an example centre (http://127.0.0.1:17888/playground/) where
every example runs directly; the code shown is the code that executes.
Running them
- Turn on the Playground in console Settings (off by default).
- Visit
http://127.0.0.1:17888/playground/. - Connect, pick a printer and follow the recommended order at the top.
Real printing is a separate switch; while it is off, examples only preview and validate.
The examples
| Example | Demonstrates |
|---|---|
| Detect the local PrintLink | PrintLink.detect() probing install and running state |
| Print a PDF silently | Upload sample.pdf → print → watch job events |
| A4 report | A code-built report: Chinese headers, rows, barcodes, date binding |
| 58 / 80mm receipt | Both thermal widths plus a QR code |
| Label | A 100×150mm label with placeholder binding |
| Print an image | A local PNG/JPEG or canvas, fitted to the chosen paper |
| Mixed multi-page | Image + PDF + template in one job, see below |
| Hiprint template | Template JSON converted through the adapter |
| Capability exploration | Reading and displaying real printer capabilities |
| Unsupported options | Observing downgrades and warnings |
| Profiles | Create / rename / set default / delete |
| Direct HTTP | The fetch flow without the SDK |
| Scan | List scanners → scan → fetch the pages |
Mixed multi-page recipes
The /playground/mixed/ page offers ready-made combinations:
| Recipe | Content |
|---|---|
| Several photos | 4 images = 4 pages in one job |
| Several PDFs | Page counts add up |
| Image + PDF + image | Thumbnails badge the different sources |
| PDF + packing slip | The slip carries its own data |
| One template × N | N pages in one job |
In the custom list you can select several PNG / JPEG / PDF files; the filmstrip order is the output order and can be dragged.