Text formatting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kako
    Junior Member
    • Apr 2026
    • 16

    #1

    Text formatting

    Hi,

    Within the "Text" field, is it possible to create formatted text? For example: bold, bullet points, colors, fonts, font size, etc.

    Thanks
    kako
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1884

    #2
    you can use a limited markdown set. There are lots of sites, explaining how. But not everything, markdown offers iss possible.

    Comment

    • kako
      Junior Member
      • Apr 2026
      • 16

      #3
      Hi, shalmaxb

      How does the Markdown appear when creating the PDF? Is it normal?

      Comment

      • yuri
        EspoCRM product developer
        • Mar 2014
        • 10095

        #4
        Hi Kako,

        You can print formatted markdown in PDF using the helper 'markdownText': https://docs.espocrm.com/user-guide/...df/#text-field. Note that currently only the classic markdown is supported there (no table support). Extra markdown syntax will be supported in the next major version.

        Comment

        • kako
          Junior Member
          • Apr 2026
          • 16

          #5
          Thanks

          Comment

          • jamie
            Senior Member
            • Aug 2025
            • 352

            #6
            Yeah, I'd love more Markdown formatting inside the PDF. Might this be part of 10?

            I am also finding some strange behaviour with regard to new lines,

            {{{markdownText cAboveAddressFreeText_RAW}}}

            puts new lines above and below the text but doesn't render new lines within the text??

            This could be a problem with 9, as we still haven't upgraded to 10, SOON!



            also some documentation describing what's available in the PDF would also be great!

            thanks
            Last edited by jamie; 10-28-2026, 11:50 AM.

            Comment

            • jamie
              Senior Member
              • Aug 2025
              • 352

              #7
              if anyone is looking for enhanced Markdown in the pdf here is a handy template helper,

              first installleague/commonmark

              then add this as a template helper

              PHP Code:
              <?php
              namespace Espo\Custom\TemplateHelpers;
              use Espo\Core\Htmlizer\Helper;
              use Espo\Core\Htmlizer\Helper\Data;
              use Espo\Core\Htmlizer\Helper\Result;
              use League\CommonMark\Environment\Environment;
              use League\CommonMark\Extension\CommonMark\CommonMarkC oreExtension;
              use League\CommonMark\Extension\Strikethrough\Striketh roughExtension;
              use League\CommonMark\MarkdownConverter;
              class pdfMarkdown implements Helper
              {
              public function render(Data $data): Result
              {
              $markdown = (string) ($data->getArgumentList()[0] ?? '');
              $environment = new Environment();
              $environment->addExtension(new CommonMarkCoreExtension());
              $environment->addExtension(new StrikethroughExtension());
              $converter = new MarkdownConverter($environment);
              $html = $converter->convert($markdown)->getContent();
              $html = str_replace(
              ['<p>', '<ul>', '<ol>', '<li>'],
              [
              '<p style="margin: 0;">',
              '<ul style="margin: 0; padding-left: 1em;">',
              '<ol style="margin: 0; padding-left: 1em;">',
              '<li style="margin: 0;">',
              ],
              $html
              );
              return Result::createSafeString($html);
              }
              }​

              Comment

              Working...