I'm attempting to extract JBIG2 images only from a PDF. The only problem is that the JBIG2 images are raw data streams without a header, and so I can't just save it into a .jb2 file, as no application will recognize it.
It looks like this:
<</Subtype/Image/Width 1740/Height 3002/ColorSpace/DeviceGray/BitsPerComponent 1/Decode[1 0]/Length 12268/Filter/JBIG2Decode>>
I can easily extract the data, but how can I repair the header?