Page-break macro for PDF export (Example implementation attached)

XMLWordPrintable

      Being able to force page breaks in PDF output is very useful, and we've added this functionality via a user macro and a patch to xhtml2fo.xsl - it would be great if this or similar functionality was included in confluence so we don't have to continue to patch it ourselves.

      Our implementation requires two patches to xhtml2fo.xsl:

      In the attribute-set section

      	<!-- START pagebreak macro patch -->
          <xsl:attribute-set name="pagebreak">
              <xsl:attribute name="break-before">page</xsl:attribute>
          </xsl:attribute-set>
          <!-- END pagebreak macro patch -->
      

      In the templates

      <!-- START pagebreak macro patch -->
          <xsl:template match="html:div[@class='pagebreak']">
              <fo:block xsl:use-attribute-sets="pagebreak">
         
              </fo:block>
          </xsl:template>
          <!-- END pagebreak macro patch -->
      

      and a user macro to reference the templates (set to Macro generates HTML markup, no body)

      <div class="pagebreak">&nbsp;</div>
      

      Please consider adding this as a feature!

            Assignee:
            Unassigned
            Reporter:
            Anthony Frith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: