1 Reply Latest reply on Aug 2, 2007 4:38 PM by kwillis

    Include PDF in CFDOCUMENT

    Wolfman_AZ
      i have a reason to build one pdf document using cfdocument that may have as it's source a mixed bag of html and pdf files.

      i am using cfhttp to retrieve the html pages, and it works great. but cfdocument chokes when a pdf file enters the stream.

      anybody have any ideas?
      <CFFUNCTION access="remote" name="Build_Rpt" output="true" returntype="any">
      <cfargument name="f_list" type="string" required="yes"/>
      <CFSET f_array = #ListToArray(#f_list#,"|")#>
      <CFSET f_ct = #ArrayLen(f_array)#>
      <CFDOCUMENT format="PDF" backgroundvisible="yes" overwrite="no" fontembed="yes">
      <CFLOOP index="x" from="1" to="#f_ct#" step="1">
      <CFDOCUMENTSECTION>
      <CFSET url.target_url = " http://blahblah.com/lp2.cfm?pagetoload=#f_array[x
      <CFHTTP url="#url.target_url#" resolveurl="yes">
      #cfhttp.filecontent#
      </CFDOCUMENTSECTION>
      <CFDOCUMENTITEM type="pagebreak"></CFDOCUMENTITEM>
      </CFLOOP>
      </CFDOCUMENT>
      </CFFUNCTION>