Skip to main content
Inspiring
October 11, 2016
Question

CFHTMLTOPDF - page breaking with page-break-after does not work

  • October 11, 2016
  • 1 reply
  • 1343 views

We've recently upgraded our production servers from CF9 to CF11 and are looking into the CFHTMLTOPDF tag to replace the existing CFDOCUMENT.

However, upon testing, CFHTMLTOPDF does not show page-break's correctly with the page-break-after:always CSS rule. See code below :

<cfsavecontent variable="x">

<html>

   <head>

      <style type="text/css">

         p {page-break-after: always;}

      </style>

   </head>

   <body>

      <p>blah</p>

      <p>blah blah</p>

   </body>

</html>

</cfsavecontent>

<cfhtmltopdf name=y pagetype="A4"><cfoutput>#x#</cfoutput></cfhtmltopdf>

<cfcontent reset="yes" type="application/pdf" variable="#ToBinary(ToBase64(y))#">


The page breaks show correctly when generating PDF using CFDOCUMENT.

<cfdocument name=y format="PDF" pagetype="A4"><cfoutput>#x#</cfoutput></cfdocument>

What is the point of CFHTMLTOPDF if it is being advertised as a feature that generates "high quality" content but it cannot even generate content formatting properly? 

Will this bug be fixed in the CFHTMLTOPDF tag?

Tested on : CF11 Update 7 / Windows

This topic has been closed for replies.

1 reply

Inspiring
October 12, 2016

I would recommend submitting this as a bug at https://bugbase.adobe.com/