Hi if you use preview, you can see directly the pdf on the screen.
If you want to use your pdf variable you can save it somewhere, for example in the attachment section of the business object (if your bo has this section) or send it via mail.
The variables docname and doctype are useful only in case you want to save the file.