Copied to clipboard

Flag this post as spam?

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


  • John 12 posts 51 karma points
    Jul 10, 2014 @ 15:12
    John
    0

    Headings on web page not produced in PDF output

    Hi

    I am using the Razor Example to produce my PDFs. The Umbraco (6.1.3) web page has headings h1,h1, h3 and h4 but none appear on the PDF output.

    My web page looks like this

    This is heading 1

    This is paragraph 1

    This is heading 2

    This is paragraph 2

    This is heading 3

    This is paragraph 3

    This is heading 4

    This is paragraph 4

    The source code produced as html looks like this

    <content>
    <h1>This is heading 1</h1>
    <p>This is paragraph 1</p>
    <h2>This is heading 2</h2>
    <p>This is paragraph 2</p>
    <h3>This is heading 3</h3>
    <p>This is paragraph 3</p>
    <h4>This is heading 4</h4>
    <p>This is paragraph 4</p>
    </content>

    The PDF output looks like this

    This is a test policy.
    This is paragraph 1
    This is paragraph 2
    This is paragraph 3
    This is paragraph 4

    Can someone help me?

    What am I missing?

    Thanks

     

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Jul 10, 2014 @ 18:14
    Darren Ferguson
    0

    Hi - PDF creator doesn't turn HTML into PDFS, it uses XSL:FO.

    Have you read the product manual?

    Thanks.

  • John 12 posts 51 karma points
    Jul 10, 2014 @ 20:02
    John
    0

    Hi Darren

    I paid £150 for your product and I expect a little more support than 'have you read the manual'.

    But to answer your questions, yes of course I have. However, I didn't find the answer, either becasue it isn't there or because I don't understand it.
    You don't seem to have understood the question in my post, I'm not trying to turn HTML in to PDF - this is afterall an umbraco package.

    I have installed your product and I am using the '[PDF] Razor Example' that is installed by default, I have made minor changes, such as column-count=1 etc..
    The following section startng at line 69 renders the 'BodyText' section, taken from the Model.

    <!-- Document Body -->
            <fo:flow flow-name="xsl-region-body">
              <fo:block>
                 @ParseRichText(FoHelper.Instance.GetRichTextNodes(@Model.BodyText))
              </fo:block>
             
              <!-- Having this before the closing tag of the body flow allows us to have a pager in the footer -->
              <fo:block id="last-page" keep-together.within-page="auto"></fo:block>
             
            </fo:flow>

    All of the body content from my umbraco web page should be rendered here, and seeing as my body content contains headings and paragraphs I would expect them to be genererated by the PDF Creator.

    So can you help me or not?

    How can I get the headings, that are within the 'BodyText' property in the template my web page uses, in to a PDF using PDF Creator?

    Thanks

     

  • John 12 posts 51 karma points
    Jul 19, 2014 @ 09:44
    John
    0

    Hi Darren

    It's been a week and you haven't replied!

    This issue is holding up the release of our project. I emialed one of your staff (Jay) for support over a week ago and he asked me to log the issue on here, I did that and you replied telling me to read the manual, needless to say your reply did not help me!
    I cannnot resolve the issue myself, maybe I'm doing something wrong but without help from you or your team to solve the issue your product is no good for our needs.

    If you can't help us then maybe you'd refund the money we paid for your product? We can then find a product that does meet our needs - I wouldn't have thought producing headers from BodyText would be that difficult to render but what do I know!

    Thanks

    John

     

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Jul 20, 2014 @ 10:11
    Darren Ferguson
    0

    I was waiting for you to reign in your attitude a little before replying - and I've also been on holiday last week.

    Your first attempt at explaining the issue was poor which was why you got quite a non-specific reply.

    So, ask the question again, minus the attitude - or request a refund. I'm fine either way.

    Thanks.

  • John 12 posts 51 karma points
    Jul 21, 2014 @ 17:03
    John
    1

     

    Dear Darren Ferguson,

    I first contacted your company by email, in which I provided a detailed description of the problem including screen shots. I sent this to the person that emailed us the licence file, assuming this would be a quick and easy way to get an answer. The reply given asked me to log the issue on the Forum, which I did and then received your reply telling me to ‘read the manual’.

    I hope you can see how this lack of support is frustrating. This is the 5th time I’m contacting your company and rather than try to help me resolve the issue you are being evasive, even in your latest response you are asking me to ‘ask the question again’!

    You seem to have lost focus, I am a customer of a product that you supply and as such I expect a certain level of support, which you are failing to provide on every request. My ‘attitude’, as you put it, is in response to your reluctance to provide any help to resolve an issue I have with a product you supplied me.

    I’d like to point out that not only are you about to lose a customer but you will also lose repeat business from me, and maybe others that read this post and see the way you respond to a customer ‘post sale’. We are also planning on undertaking some Umbraco training and we were considering your company (Moriyama) as the supplier of that training. Needless to say, after your handling of this support request we will not be putting that business your way.

    I will be requesting a refund. Having contacted you 4 times previously and asking the same question twice I don’t see how asking it again is going to get the result that should have been provided at the beginning of this request.

    Yours sincerely
    John

  • Darren Ferguson 1022 posts 3259 karma points MVP c-trib
    Jul 22, 2014 @ 13:56
    Darren Ferguson
    0

    John - I don't wish to get involved in an unconstructive debate with you. I've requested a call to organise your refund and discuss the conditions of this refund. You've refused the call. I've called your office and left my details so you can reach me.

    Until such time that we speak nothing further will happen on this. 

    The answer to your original query is readily and easily available in the product manual. My original offer that you communicate with us in a reasonable fashion and receive our support still stands. Otherwise, please call me so I can arrange your refund.

    Laslty, I'm going to draw a line under our correspondence here via email, forum post or otherwise. You know how to reach me if you need.

  • Doogie Talons 183 posts 318 karma points
    Jun 15, 2016 @ 10:40
    Doogie Talons
    1

    Hi there as Darren said it uses a different markup language which you can style inline.

    In my layout I use the helpers provided with the package but change them.

       @helper ParseElement(XmlNode node) { 
          <!-- @node.Name -->
          switch(node.Name) 
          {
            case "p":
              <fo:block margin-bottom="0.5cm" color="#333333">
                @ParseRichText(node.ChildNodes)
              </fo:block>
              break;
            case "strong":
              <fo:inline font-weight="bold">
                @ParseRichText(node.ChildNodes)
              </fo:inline>
              break;
            case "em":
              <fo:inline font-style="italic">
                @ParseRichText(node.ChildNodes)
              </fo:inline>
              break;
             case "h1":
              <fo:block font-size="22pt" font-family="Stag Sans Web Semibold Regular" margin-bottom="0.5cm">
                @ParseRichText(node.ChildNodes)
              </fo:block>
              break;  
            case "a":
              <fo:basic-link color="#00969d" text-decoration="none" external-destination="url('@node.Attributes["href"].Value')">
                @ParseRichText(node.ChildNodes)
              </fo:basic-link>
              break;
            case "u":
              <fo:inline text-decoration="underline">
                @ParseRichText(node.ChildNodes)
              </fo:inline>
              break;
            case "ol":
              <fo:list-block margin-bottom="0.5cm">
                @ParseRichText(node.ChildNodes)
              </fo:list-block>
              break;
            case "ul":
              <fo:list-block margin-bottom="0.5cm">
                @ParseRichText(node.ChildNodes)
              </fo:list-block>
              break;
              case "br":
             <fo:block/>
              break; 
    
            case "li":
              <fo:list-item padding-bottom=".25cm" font-style="italic">
                <fo:list-item-label>
                  <fo:block>•</fo:block>
                </fo:list-item-label>
                <fo:list-item-body>
                  <fo:block margin-left="0.5cm" color="#333333" >
                   @ParseRichText(node.ChildNodes)
                  </fo:block>
                </fo:list-item-body>
              </fo:list-item>
              break;
            case "img":
              var docRoot = IOHelper.MapPath("~/");
              <fo:block>
                <fo:external-graphic src="@docRoot/@node.Attributes["src"].Value" content-width="9cm"/>
              </fo:block>
              @ParseRichText(node.ChildNodes)
              break;
          }
      }
    
      @helper ParseRichText(XmlNodeList nodes) {
        foreach(XmlNode node in nodes) {
    
           switch(node.NodeType)
           {
               case XmlNodeType.Text:
                 @node.Value
                 @ParseRichText(node.ChildNodes);
                 break;
               case XmlNodeType.Element:
                 @ParseElement(node);
                 break;
               default:
                 @ParseRichText(node.ChildNodes);
                 break;
           }
        }
      }
    

    You will need to add more cases to cover the different headings and style each one accordingly.

    Then within the template you call them like...

     <fo:block font-family="Stag Sans Web Light Regular">
    @ParseRichText(FoHelper.Instance.GetRichTextNodes(@contentString))
      </fo:block>
    

    Where contentString contains a rich text string.

    I hope this helps.

    Doogie

Please Sign in or register to post replies

Write your reply to:

Draft