Highlighted

probleme with pagebreak in cfdocument

New Here ,
Jan 28, 2018

Copy link to clipboard

Copied

I'm trying to generate a multi page pdf. One per record. I'm using div for precise positioning. The result is good for a single record. But if I loop over multiple records (see below) the page break has an odd behaviour.It chops at the beginning of the each page and prints everything on the last one . If I don't use the page break, everything is printed on the first page. What am I missing ?

<cfdocument

        format="pdf"

        pagetype="legal"

        orientation="portrait"

        fontEmbed="true"

        unit="cm"

        localUrl="true"

        saveAsName="recus_impot"

        marginLeft="0"

        margintop="0"

        marginright="0"

        marginbottom="0">

         <style>

        div.verySmall {

          font: 7pt Arial;

          line-height: 12pt;

        }

        div.small {

          font: 8pt Arial;

          line-height: 10pt;

        }

        div.text {

          font: 10pt Arial;

          line-height: 14pt;

        }

        div.title {

          font: 11pt Arial;

          line-height: 14pt;

        }

        div.number {

          font: 18pt Arial;

        }

    </style>

     <cfoutput query="donors">

          <div style="position:relative; top:0mm; left:0mm; width:216mm;">

               <div  class="title" style="position:absolute; top:5mm; left:5mm;">

                RE&Ccedil;U OFFICIEL AUX FINS DE L'IMP&Ocirc;T SUR LE REVENU (Donateur)<br>

               </div>

               <div  class="text" style="position:absolute; top:10mm; left:5mm;">

                     <strong>#organisme.organisme#</strong><br>

                      #organisme.adresse#, #organisme.ville# (#organisme.province#) #organisme.code_postal#<br>

                       #organisme.telephone#

                 </div>

                   ...

          </div>

          <cfdocumentItem type="pagebreak" />

     </cfoutput>

</cfdocument>

Views

100

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

probleme with pagebreak in cfdocument

New Here ,
Jan 28, 2018

Copy link to clipboard

Copied

I'm trying to generate a multi page pdf. One per record. I'm using div for precise positioning. The result is good for a single record. But if I loop over multiple records (see below) the page break has an odd behaviour.It chops at the beginning of the each page and prints everything on the last one . If I don't use the page break, everything is printed on the first page. What am I missing ?

<cfdocument

        format="pdf"

        pagetype="legal"

        orientation="portrait"

        fontEmbed="true"

        unit="cm"

        localUrl="true"

        saveAsName="recus_impot"

        marginLeft="0"

        margintop="0"

        marginright="0"

        marginbottom="0">

         <style>

        div.verySmall {

          font: 7pt Arial;

          line-height: 12pt;

        }

        div.small {

          font: 8pt Arial;

          line-height: 10pt;

        }

        div.text {

          font: 10pt Arial;

          line-height: 14pt;

        }

        div.title {

          font: 11pt Arial;

          line-height: 14pt;

        }

        div.number {

          font: 18pt Arial;

        }

    </style>

     <cfoutput query="donors">

          <div style="position:relative; top:0mm; left:0mm; width:216mm;">

               <div  class="title" style="position:absolute; top:5mm; left:5mm;">

                RE&Ccedil;U OFFICIEL AUX FINS DE L'IMP&Ocirc;T SUR LE REVENU (Donateur)<br>

               </div>

               <div  class="text" style="position:absolute; top:10mm; left:5mm;">

                     <strong>#organisme.organisme#</strong><br>

                      #organisme.adresse#, #organisme.ville# (#organisme.province#) #organisme.code_postal#<br>

                       #organisme.telephone#

                 </div>

                   ...

          </div>

          <cfdocumentItem type="pagebreak" />

     </cfoutput>

</cfdocument>

Views

101

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jan 28, 2018 0

Have something to add?

Join the conversation