<cfdocument> allows you to specify a variable (I think
the attribute is "Name") in which to store the postscript code for
the PDF. You could certainly return that value via a webservice,
but the application that consumed the webservice would need to be
able to set the correct mime type before displaying the postscript
code to the browser.
Something like this (the code is quick and dirty so there
might be some errors, but it should give you a general idea):
Your Webservice Component:
------------------------------------------------------
<cffunction name="myTest" returntype="string"
access="remote">
<cfdocument name="psText">
<b>This is a test</b>
</cfdocument>
<cfreturn psText>
</cffuncion>
Consume Webservice
----------------------------------------------
<cfsetting enablecfoutputonly="Yes">
<cfset objWS = CreateObject("webservice", "
http://www.mysite.com/ws/mywebservice.cfc?wsdl")>
<cfset sPDFText = objWS.myTest()>
<cfcontent
type="application/pdf"><cfoutput>#sPDFText
#</cfoutput>