3 Replies Latest reply on Dec 8, 2006 7:59 PM by Newsgroup_User

    CFML to PDF

      Where is it not outputing the direct content without the tags? I can create the pdf for the browser and create the pdf, however, the pdf shows all the html code and not the desired output. (Shows <img src="logo.gif"><p><strong>Hello.....) When I want the pdf to show the image and not the backend. Here is the code:

      <cfset PDFname = "#getfile.filenum#_contact.pdf">
      <cfset mydirectory = "C:\CFusionMX7\wwwroot\AMS\#PDFname#">
      <cfheader name="Content-Type" value="pdf">
      // create a 'Document' object
      document = CreateObject("java", "com.lowagie.text.Document");
      // get an outputstream for the PDF Writer
      fileIO = CreateObject("java", "java.io.FileOutputStream");
      // call the constructor, pass the location where you want
      // the pdf to be created
      // get a PDF Writer var
      writer = CreateObject("java", "com.lowagie.text.pdf.PdfWriter");
      // call the static 'getInstance' factory method
      writer.getInstance(document, fileIO);
      // open the document
      // create a new paragraph
      paragraph = CreateObject("java", "com.lowagie.text.Paragraph");
      // create a new chunk
      //chunk = CreateObject("java", "com.lowagie.text.pdf.PdfContentUnder");
      // create a new paragraph
      // add the paragraph
      // close the document (PDF Writer is listening and will automatically
      // create the PDF for us

      Please reply with any advice, Thanks.