Reputation: 107
I'm currently trying to write a bash script to allow for a user to enter text for a barcode they need printing (type C128) and then either:
This is the site in particular:
Replace TEST1 with any text.
I've tried using wget, curl, html2ps, html2ps + ps2pdf but I am running into an issue which originates from the base of the URL page:
https://www.barcodesinc.com/generator/image.php
Via CLI I get this:
"Need bar code type ex. C39"
The aim is to print the image locally or save it then print it.
This is what I have tried so far:
#!/bin/bash
echo -ne "Enter the ID you want to print: "
read locid
#html2ps https://www.barcodesinc.com/generator/image.php?code=LOCATION$locid&style=165&type=C128B&width=388&height=150&xres=2&font=5 | lpr
#html2ps https://www.barcodesinc.com/generator/image.php?code=LOCATION$locid&style=165&type=C128B&width=388&height=150&xres=2&font=5 | ps2pdf - /home/byron/locations/LOCATION$locid.pdf
#html2ps https://www.barcodesinc.com/generator/image.php?code=LOCATION$locid&style=165&type=C128B&width=388&height=150&xres=2&font=5 -o /home/byron/locations/LOCATION$locid.html
#ps2pdf /home/byron/locations/LOCATION$locid.html /home/byron/locations/LOCATION$locid.pdf
lpr /home/byron/locations/LOCATION$locid.pdf
When using any CLI tools I seem to be getting an empty file or stdout output. Additionally the printing job gets immediately cancelled and shows "(stdin) to printer".
I tried https://unix.stackexchange.com/questions/168569/printing-webpage-using-browser-via-cli as above but it didn't work.
Upvotes: 0
Views: 251
Reputation: 7954
It looks like barcodesinc.com no longer supports hotlinking: only pages on its own domain can use, open or create the barcode images...
I would suggest to use a different barcode image server. For example, I just found a10.selenode.com:
wget
"https://a10.selenode.com/code128/TEST1"
Upvotes: 0
Reputation: 1382
Why are you trying to use LOCATION$locid
and not just $locid
?
#!/bin/bash
read -p "enter LocationID:" locid
wget -O $locid.gif "https://www.barcodesinc.com/generator/image.php?code=$locid&style=165&type=C128B&width=388&height=150&xres=2&font=5"
Successfully downloaded the image called test1
Upvotes: 1