To install jsPrintWinApi, download this GitHub project as a zip file and rename the file extension from .zip to .xpi. Then open the file in Firefox by pressing Ctrl+O or by dragging and dropping the file inside Firefox.
getMediaTypeNames(printerName): Returns the available media types for a printer as an object whose keys are media type names and values are their numeric IDs.
getMediaType(printerName): Returns the current media type as a number (media type numbers are printer-specific).
setMediaType(printerName, mediaType): Changes the per-user media type for a printer. The media type can be either a string or the numeric ID.
jsPrintSetup does not let the media type to be changed because media types are driver-specific and Firefox does not expose any way (at least not any easy way) to change that setting programmatically.
jsPrintWinApi gets around this by calling the Windows Print Spooler API directly. More specifically, the media type that Firefox uses for printing can be changed my modifying the Per-User DEVMODE which is stored in the user's registry. Changing it does not require administrator rights and the value only affects the current user.
Normally this value can be changed by opening the Printer Properties dialog. This is not a satisfactory solution when there are a lot of documents that need to be automatically printed on different media types, and without any user intervention.
This project is released under the MIT License. Please feel free to use, modify and merge the code freely.