Second issue: I’m trying to create a system for creating Parking Passes and Tickets for the TidySpace system at VHS. So ultimately allowing the user via a webpage to fill in HTML form values, and passes them into a template for printing on the printer.
Here’s how I would accomplish this off the top of my head (and with a bit of googling). You’ve undoubtedly thought of some of this already, but I’ll write it all out in case it creates a new lead for you try.
Create a python webapp which runs on the RasPi, and serves a web page internally at http://tidy.vanhack.ca (similar to how the laser pi works). For this you could use Pyramid or Flask or something else.
Create a python module that can generate a PostScript file dynamically using PSFile.
Or, it may be possible to create PostScript “templates” elsewhere such as Illustrator, and leave placeholders like $#NAME#$ in the text. Then use python to do string replacement to change those placeholders out for specific values.
Set up the printer with the RasPi such that you can print using the lpr command line utility as described here. This might be quite fiddly, but can be worked on and tested without worrying about Python. Just make sure it’s possible to print a PostScript file with lpr test.ps.
Hook it all together. The Web app authenticates with Nomos (or whatever), has an interface to request and catalogue parking tickets, and has a “Print ticket” function which:
Uses PSFile to dynamically generate a PostScript file with the desired information
Pipes the contents of that file to lpr
Alternatively, I learned that wxPrint has HtmlEasyPrinting functionality which I think lets you pipe an HTML-formatted document to it, and it’ll print it. That sounds convenient, but surely has a lot more complicated things internally (like an entire web rendering engine?) so YMMV.