function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
V100V100 

ol li problems when rendering PDF

I have seen some discussion on these problems and some solutions too, however i cannot find on the addresses my issue.
I am trying to do the following
<ol>
<li>Item 1</li>
<apex:outputPanel rendered="IF Statement">
     <li>Optional item a</li>
</apex:outputPanel>
<li>Item 2</li>
</ol>

This renders on the PDF as:
     Item 1
     Optional item a
     Item 2
Whereas in html:
     1. Item 1 
     2. Optional item a
     3. Item 2

I know there is incomplete support for the pdf rendering engine but does anyone know of a workaround for this?
crop1645v2crop1645v2
Ah yes, this drove me nuts.  Outline of the solution:
  1. You need to use a different VF page for the PDF version than the HTML version
  2. The PDF VF page needs its own stylesheets that are different from the HTML version (at least for the areas that you are having rendering issues)
In my case, my PDF VF page overrode the default styles for ul and ol tags as follows:

ol { padding-left: 1.0em; list-style: decimal; }
ul { padding-left: 1.0em; list-style: disk; }

and I got more or less what I wanted
V100V100
Thanks for the suggestion.
Used apex:outputText and that seemed to retain the numbering rather than apex:outputPanel