PDF Save to File

Does anyone have code that would just save a PDF Manager record as a PDF to the filesystem on the server.  I have tried several different ways but my closest attempt still mangles the logo at the top of the page while the built in code (to download it) works 100%.  I just cant find what I am missing.