0

In Eclipse Java I am using Print API and when attempting to print receive INFO messages as such:

Oct 31, 2011 5:48:58 PM org.apache.pdfbox.util.PDFStreamEngine processOperator INFO: unsupported/disabled operation: i

Oct 31, 2011 5:48:59 PM org.apache.pdfbox.util.PDFStreamEngine processOperator INFO: unsupported/disabled operation: i

Is there any way to extract the message that INFO gives that is "unsupported/disabled operation: i". Perhaps a get() method somehow? Thanks

user1022570
  • 61
  • 1
  • 3
  • 7

1 Answers1

1

The messages you are looking for are stored in org.apache.pdfbox.util.PDFStreamEngine#unsupportedOperators field of Set<String> type.

Unfortunately this field is private final with no accessors (?) You can use reflection to obtain it, but this is far from being elegant. Nevertheless see: How do I read a private field in Java?

However I cannot say that writing a custom logging appender (which is a second solution) is more elegant... You haven't mentioned which logging framework you use. Looks like java.util.logging, check out this. For Log4J this will be a good start.

Community
  • 1
  • 1
Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
  • Looks like PDFBox uses Apache's commons logging. So I'm guessing it's trying to find a suitable framework at runtime and comes up with `java.util.logging`. – G_H Oct 31 '11 at 22:18