It's not unheard of for hackers/malware to hijack printers, but I'm not convinced this is ransomware just yet.
The mark of ransomware, usually, is that files on your computer become encrypted and the user receives a message, often which takes up the entire desktop or appears on boot, informing the user that files have been encrypted and demanding a ransom. You can see some examples here:
https/www.avast.com/ransomware-decryption-tools
I would strongly recommend isolating the affected devices (and the printer) and running scans on those devices to remove any malware/etc. as well as any further investigation needed before you re-introduce them to the network. Even if it's not ransomware, that doesn't mean it isn't harmful.