问题
I'm trying to create functionality to output pages generated from MYSQL queries in PHP as PDF files.
To do this I need a way of wrapping up this data that is placed into dynamic tables and placing it between the tags, so it can be converted into a clean PDF.
I'm not sure where to start with this other than the coldfusion component will be called from the PHP page, rather than the other way round as I originally envisaged.
回答1:
I would pull the dynamic content from your php scripts like this:
<CFDOCUMENT format="pdf" src="url-to-php-script.php" mimetype="text/html" filename="#expandpath("your.pdf")#" />
回答2:
The part where the Coldfusion Component gets called by php is pretty simple to accomplish. Inside the the cfc you will have functions. If you make the access property = remote, that function will be available as a web service.
<cffunction name="NameOfFunction" access="remote" returntype="something">
来源:https://stackoverflow.com/questions/14237047/how-to-send-data-from-mysql-php-to-a-coldfusion-component