Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • tbisof 7 posts 87 karma points
    Aug 26, 2015 @ 09:37

    PDF output not respecting line breaks

    This is the second issue from my previous thread.

    The PDF generator is not respecting HTML line breaks in the generation of the PDF file, but instead prints out one big chunk of text. Due to this, we have to go and manually edit the HTML in Umbraco for each post to get the formatting right. Our solution so far was to replace the line breaks (which Umbraco automatically adds as you use the text editor) with paragraph tags which print out in the PDF correctly.

    You can see this more clearly in the examples below: (before fix) (after fix)

    Thanks for any help you can provide,


  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Aug 26, 2015 @ 13:18
    Darren Ferguson

    In the sample templates you'll see a function ParseElement.

    You need to add a case that replaces the br tag with something - probably a fo:block of a fixed height:

    @helper ParseElement(XmlNode node) { 
      @* @node.Name *@
        case "p":
          <fo:block margin-bottom="0.5cm">
        case "strong":
          <fo:inline font-weight="bold">
        case "em":
  • tbisof 7 posts 87 karma points
    Aug 27, 2015 @ 07:44

    Thank you very much! Adding a case for br fixed the problem.

    case "br":
            <fo:block margin-bottom="0.25cm">
Please Sign in or register to post replies

Write your reply to: