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 ?
Asked
Active
Viewed 33 times
0

Prateek
- 2,375
- 19
- 23

rob schoenmaker
- 1
- 1
-
It was removed in 2014 due to poor performance, see https://issues.apache.org/jira/browse/PDFBOX-1963 07/Mar/14 14:02 . The solution would be to render to RGB and then convert to whatever unsupported type you want. – Tilman Hausherr Aug 02 '16 at 20:10
-
@Tilman that comment qualifies as an answer. – mkl Aug 03 '16 at 04:14
-
@mkl ok, done. Initially at that time, TYPE_BINARY was removed as well. – Tilman Hausherr Aug 03 '16 at 05:11
1 Answers
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