2 Replies Latest reply on Mar 26, 2013 9:24 AM by sircrom

    CFDocument(PDF) - Fonts

    sircrom

      CFDocument does not render my fonts in the PDF

       

      I tried the following things:

       

      • Add the Font in the CFAdmin(.ttf)
      • Try to use the <font> - Tag instead of CSS
      • Add the Font via @font-face in CSS

       

      I use Coldfusion 9 on Linux

       

      Here is the code, which i use to generate my PDF

       

        <CFFILE action="write" file="mydocument.pdf" output="#content#" mode="777" />

        <cfheader name="Content-Disposition" value="attachment; filename=mydocument.pdf">

        <cfcontent type="application/pdf" variable="#content#" />

        • 1. Re: CFDocument(PDF) - Fonts
          Dan Bracuk Level 5

          Why are you using cffile instead of cfdocument or cfpdf?

          • 2. Re: CFDocument(PDF) - Fonts
            sircrom Level 1

            That's only a intermediate step to save my pdf on the server.

             

            My Codeorder looks like this:

             

            <CFDOCUMENT name="content" format="pdf" pageType="A4" localurl="yes" fontembed="no" marginbottom="0" margintop="1" unit="cm">

             

                 <!--- MY HTML --->

             

            </CFDOCUMENT>

             

            <CFFILE action="write" file="mydocument.pdf" output="#content#" mode="777" />

            <cfheader name="Content-Disposition" value="attachment; filename=mydocument.pdf">

            <cfcontent type="application/pdf" variable="#content#" />