This is an archived forum post. The information may be outdated. Contact us if you have any questions.

How to format Table Of Contents (TOC)

philipfc wrote on 2013-07-09:
I know I need to generate my own TOC when using pdfcrowd.

I would like to know what HTML / CSS you suggest for showing leaders (i.e. dots between the section name and the page number).

I am trying to do that and have tried the CSS found at http://www.w3.org/Style/Examples/007/leaders.en.html in the section CSS RULES.

That CSS works fine in the latest version of Chrome but not when used with pdfcrowd.

Any ideas on alternates that will work for showing leaders?
support wrote on 2013-07-10:
Hello,

I tested the workaround for CSS2 mentioned on the page you refer to and it seems to me that it works fine with Pdfcrowd.
Below is the code taken verbatim from that page. Simply paste it here and click the "Convert to PDF" button.
<html>
  <head>
    <style>
      ul.leaders {
        max-width: 40em;
        padding: 0;
        overflow-x: hidden;
        list-style: none
      }
      ul.leaders li:before {
        float: left;
        width: 0;
        white-space: nowrap;
        content:
          ". . . . . . . . . . . . . . . . . . . . "
          ". . . . . . . . . . . . . . . . . . . . "
          ". . . . . . . . . . . . . . . . . . . . "
          ". . . . . . . . . . . . . . . . . . . . "
      }
      ul.leaders span:first-child {
          padding-right: 0.33em;
          background: white
      }
      ul.leaders span + span {
          float: right;
          padding-left: 0.33em;
          background: white
      }
    </style>
  </head>
  <body>
    <ul class=leaders>
      <li><span>Salmon Ravioli</span>
        <span>7.95</span>
      <li><span>Fried Calamari</span>
        <span>8.95</span>
      <li><span>Almond Prawn Cocktail</span>
        <span>7.95</span>
      <li><span>Bruschetta</span>
        <span>5.25</span>
      <li><span>Margherita Pizza</span>
        <span>10.95</span>
    </ul>
  </body>
</html>
philipfc wrote on 2013-07-15:
You're right. It is working. I'm not sure what the error was before. Thank you for checking it out.