1

In a project of mine, I have a functionality that converts an HTML text into a PDF file. I use iText 2.1.7 for that, more specifically the HTMLWorker class. By the way, users can also put ordered lists (<ol>) in that, and having them starting with a given index. Like this:

enter image description here

The corresponding HTML is this:

<ol start="4" style="list-style-type: decimal;">
...
</ol>

However, iText - during the conversion - skips the start attribute, producing a list that starts from 1:

enter image description here

Is there a way to maintain that attribute, and producing the same result in the final PDF? Thank you for any insight.

Bruno Lowagie
  • 75,994
  • 9
  • 109
  • 165
Andrea
  • 6,032
  • 2
  • 28
  • 55
  • I couldn't ended up with a definitive solution in the environment of mine but, for people having the same problem, converting the `start=n` into n-1 invisible `
  • ` does the trick. Look here for an example of what I'm talking about: https://stackoverflow.com/questions/52205675/regex-how-to-substitute-a-string-with-n-occurrences-of-a-substring
  • – Andrea Sep 06 '18 at 14:21