0

I am trying to migrate from PDFBox 1.8.8 to 2.0.1 but what is the equivalent to use for TYPE_BYTE_INDEXED in PDFBox 2.0.x ?

Prateek
  • 2,375
  • 19
  • 23

1 Answers1

1

Rendering to TYPE_INDEXED was removed in 2014 due to alleged poor performance, see here.

...because it prevents the user from passing in arbitrary types which are known to cause poor performance e.g. TYPE_INT_BGR, well actually any type other than TYPE_BYTE_BINARY, TYPE_BYTE_GRAY, TYPE_INT_RGB or TYPE_INT_ARGB.

The solution would be to render to RGB and then convert to whatever unsupported type you want.

Tilman Hausherr
  • 17,731
  • 7
  • 58
  • 97