Generate a pdf and return as a HTTP response

Hi, I would like to generate a pdf file from some arbitrary data and return it back in a HTTP response using Akka-http, can you kindly advise, how one would achieve this, please.

Thank you kindly for your assistance