You can take a look at how the document viewer widget works.
Here's what I would do: make a non-persistent entity that is generated through a microflow. This microflow takes in the PDF and convert it to a base64 encoded string, adding this string to a string attribute in the non-persistent entity. The Community Commons module has a method like that, as far as I know.
That string could be used by a custom widget to send it to a thermal printer.