I'm trying to convert some .jb2e
images, which I extracted from a PDF, into a proper, common image file format like PNG or JPG. I tried using jbig2dec
, but that told me
jbig2dec FATAL ERROR Not a JBIG2 file header
What else can I try?
I'm using Devuan ASCII (~= Debian Stretch).
Best Answer
I ran into the same issue, and was able to get PNG versions by using
pdfimages
from the Poppler utils on the original PDF, with the-png
flag (and not the-all
flag), so that it outputs all the images in the PDF as PNGs.This is because the
-png
flag is not the same as the-j
and-jbig2
flags (all of these are selected by-all
):-png
sets the output format, which is the default for all images to be output as, converting if necessary. Converting is actually the default forpdfimages
; with no format flags, it converts all images to PBM and PPM files.-j
and-jbig2
, on the other hand, specify not to convert images of those types, thus they are output in their original format. (Note that this means there's no option to convert images to JPEG in this program; only files stored as JPEGs are output as JPEG with the-j
option.)