Announcement

Collapse
No announcement yet.

Carriage return PDF and Text doc formatting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Carriage return PDF and Text doc formatting

    This is a really simple question but I can?t get it to work.

    When creating a pdf or a text file how do you create carriage return in the Template?

    ${x} ${y}

    out put.
    -------
    Hi
    K
    --------


    Thank you.

  • #2
    Re: Carriage return PDF and Text doc formatting

    For a text file, just hit enter twice in the template area. If it is coming from javascript, use the string '\n' for a newline.

    For PDF, you can use <br/> to insert new lines. (Or <p></p> for paragraphs)
    Chris Lang

    Comment


    • #3
      Paste the following into your javascript transform:

      for each (seg in msg..OBX){
      pdfTemplate = pdfTemplate + seg['OBX.5']['OBX.5.1'] + '\n';
      pdfTemplate = pdfTemplate +"<br/>"
      }


      This will generate the requested results

      Comment


      • #4
        I also wanted to use this, specifically I was using the destination as a file logger. The only solution I found was to generate a transformer which put a channel variable to put in \r\n as so:
        channelMap.put('nl','\r\n');

        then call this variable at the end of each line in the template like so:

        ******************${nl}
        ${message.encodedData}${nl}
        ${date.get('yyyy-M-d H.m.s')}${nl}
        ${Query}${nl}
        ${error}${nl}
        *****************${nl}

        Comment

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎