Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
software:receiptprinterd [2025/12/31 11:17] diamondsoftware:receiptprinterd [2026/01/05 07:06] (current) – unfluff diamond
Line 11: Line 11:
 ### Printing Text ### Printing Text
  
-To print a simple string, it should do:+To print a simple string:
  
-`curl -L http://nixos-media-box.local/receipt -F "text=Hello, world!"`+```sh 
 +curl -L http://nixos-media-box.local/receipt -F "text=Hello, world!" 
 +```
  
-To print a file or print from stdin, it should do:+To print a file:
  
-`curl -L http://nixos-media-box.local/receipt -F "text=@/path/to/file"` `echo "Hello, world!" | curl -L http://nixos-media-box.local/receipt -F "text=@-"`+```sh 
 +curl -L http://nixos-media-box.local/receipt -F "text=@/path/to/file" 
 +``
 + 
 +To print from stdin: 
 + 
 +```sh 
 +echo "Hello, world!" | curl -L http://nixos-media-box.local/receipt -F "text=@-" 
 +```
  
 ### Printing an Image ### Printing an Image
  
-To print an image, it should do:+To print an image:
  
-`curl -L http://nixos-media-box.local/receipt/image -F "image=@/path/to/image.jpg"`+```sh 
 +curl -L http://nixos-media-box.local/receipt/image -F "image=@/path/to/image.jpg" 
 +```
  
-Any image format supported by [Pillow](https://pypi.org/project/pillow/) will be supported. This includes JPEG and PNG.+Any image format supported by [Pillow](https://pypi.org/project/pillow/) will be supported here as well. This includes JPEG and PNG.
  
 If the image is too wide, it will be automatically shrunk. If the image is too wide, it will be automatically shrunk.
Line 31: Line 43:
 If the image is in landscape orientation, it will automatically be rotated to fit the receipt. There is currently no way to turn this off. If the image is in landscape orientation, it will automatically be rotated to fit the receipt. There is currently no way to turn this off.
  
-If the image is too dark, it can try:+If the image is too dark, you can set the brightness filter:
  
 ```bash ```bash
Line 37: Line 49:
    -F "image=@/path/to/image.jpg" \    -F "image=@/path/to/image.jpg" \
    -F "brightness=0.85"    -F "brightness=0.85"
- 
 ``` ```
  
Line 44: Line 55:
 ### Printing a QR Code ### Printing a QR Code
  
-To print a QR code encoding some text, it should do:+To print a QR code encoding some text:
  
-`curl -L http://nixos-media-box.local/receipt/qr -F "text=youtu.be/xuzKafChH7k"`+```sh 
 +curl -L http://nixos-media-box.local/receipt/qr -F "text=youtu.be/xuzKafChH7k" 
 +```
  
 ### Printing Without Cutting (Continuous Printing) ### Printing Without Cutting (Continuous Printing)
Line 52: Line 65:
 By default, after each printing request, the server will command the printer to cut the paper. To change this behavior, add: By default, after each printing request, the server will command the printer to cut the paper. To change this behavior, add:
  
-`-F cut=false`+``` 
 +-F cut=false 
 +```
  
-It may also manually command the printer to cut via a request:+You may also manually command the printer to cut via a request:
  
-`curl -L -X POST http://nixos-media-box.local/receipt/cut`+```sh 
 +curl -L -X POST http://nixos-media-box.local/receipt/cut 
 +```
  
 ### API Documentation ### API Documentation