• I'm not 100% sure of the context.

    I've done this a few times in a web application to show the pdf to the web users (no differences there... materialized pdf can be shown or sent).

    I don't understand if and why you want to do this on the server.

    So what's the full story about this business requirement?