package ch.elexis.core.pdfbox;

import javax.imageio.spi.IIORegistry;
import javax.imageio.spi.ImageReaderSpi;

import org.apache.pdfbox.jbig2.JBIG2ImageReaderSpi;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

public class Activator implements BundleActivator {
	
	@Override
	public void start(BundleContext context) throws Exception{
		// PDFBox uses Serviceloader to access the JGIB2 implementation
		// we don't have a separate service loader plugin, so we d
		IIORegistry defaultInstance = IIORegistry.getDefaultInstance();
		boolean registerServiceProvider = defaultInstance
			.registerServiceProvider(new JBIG2ImageReaderSpi(), ImageReaderSpi.class);
		System.out.println("registered " + registerServiceProvider);
	}
	
	@Override
	public void stop(BundleContext context) throws Exception{}
	
}

@@ -157,16 +157,71 @@
 derSpi;%0A
+import org.apache.pdfbox.jbig2.util.log.LoggerFactory;%0A
 import o
@@ -255,16 +255,16 @@
 ivator;%0A
-
 import o
@@ -548,16 +548,56 @@
  so we d
+irectly%0A%09%09// register within IIORegistry
 %0A%09%09IIORe
@@ -791,38 +791,120 @@
 ;%0A%09%09
-System.out.println(%22registered
+LoggerFactory.getLogger(getClass()).debug(%22IIORegistry registered %22%0A%09%09%09+ JBIG2ImageReaderSpi.class.getName() + %22
  %22 +

Install missing jbig2-imageio compression format