Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

CFHTMLtoPDF - page breaking

$
0
0

I am attempting to force a page break in my PDF and not having any luck, wondering if anyone have an suggestions that might help.

 

 

<cfhtmltopdf marginBottom="1"

     marginLeft="1"

     marginRight="1"

     marginTop="1"

     orientation="portrait"

     pageType="letter"

     saveAsName="PersonsName">

 

    <cfinclude template="/dsp_create_pdf.cfm">

 

</cfhtmltopdf>

 

dsp_create_pdf.cfm contains a loop and I want to add a Page Break before each title header (to Keep it simple).

 

BUT reading documentation on cfhtmltopdfitem reads:

 

pagebreak: can be used to insert a pagebreak in the generated PDF. When <cfhtmltopdf> is used as a service, pagebreak will not work


We WANT to us cfhtmltopdf as a service, so how is this accomplished.


CSS with <p style="page-break-before: always"> </p> DOES NOT work either.


dsp_create_pdf.cfm:


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

    <title>My PDF wihout page breaks</title>

    <cfoutput>

    </cfoutput>

 

 

    <style type="text/css">

        .pdf

        {

           font-size:18pt;

           font-family:"Times New Roman";

        }

    </style>

 

 

</head>

 

 

<!--- get my data --->

<cfinclude template="qry_websrg70.cfm">

 

 

<body>

 

 

<div class="pdf" align="center">

  <table>

  <tr>

  <td align="center" colspan="3">

  Title

  </td>

  </tr>

  <tr>

  <td align="center" colspan="3">

  <cfoutput>

     #PersonsName#

                </cfoutput>

  </td>

  </tr>

  <tr>

  <td align="center" colspan="3">

  <cfoutput>

     #NOW()#

  </cfoutput>

  </td>

  </tr>

  <tr>

  <td align="center" colspan="3">

   

  </td>

  </tr>

  <cfoutput query="qLetter">

 

 

            <cfswitch expression="#CONTENT_IND#">

 

 

                <cfcase value="GRDIST">

                <tr>

                    <td align="left" colspan="3">

                    <!---Page Break here--->

                        <!---<cfhtmltopdfitem type="pagebreak" />--->

  <p style="page-break-before: always"> </p>

                    </td>

                </tr>

               </cfcase>

 

 

            </cfswitch>

  <tr>

  <td align="left">

  <u>#data1#</u>

  </td>

  </tr>

  <tr>

  <td align="left" colspan="3">

                #l_comments#

  </td>

  </tr>

  <tr>

  <td align="center" colspan="3">

   

  </td>

  </tr>

  </cfoutput>

  </table>

 

 

</div>

 

 

</body>

 

 

</html>


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>