0

I am using PDFBox 2.0 to do a HTML to PDF conversion. This is going quite well, except that I am stuck at converting the list item tag to a bullet (black, round, disc).

The official Unicode bullet character is U+2022, however none of the fonts in PDFBox support characters above the 8-bit range. I have tried embedding and using some of the fonts in the Windows font folder "C:\Windows\Fonts", but they do not seem to support more than 8-bit either.

PDFBox has a class called PDListAttributeObject which seems to have something to do with lists and bullets, but I cannot find any examples of how to use it.

So, my questions are:

  1. Can I use PDListAttributeObject in PDFBox to write a bullet character to the contentstream? and if so, how?
  2. Are there any standard Windows fonts that can render a bullet character?
  3. Any other suggestions on how to get a bullet character written to a PDF?
tcelvis
  • 155
  • 2
  • 14

1 Answers1

2

The solution, in this case, was to use the font included with PDFBox 2.0 (LiberationSans-Regular.ttf).

As a follow-up, I will now try to check which standard Windows fonts can render the bullet character. Perhaps by iterating over the fonts in the Windows/Fonts folder and checking using the PDType0Font.hasGlyph() method.

Thanks Tilman :-)

Community
  • 1
  • 1
tcelvis
  • 155
  • 2
  • 14