To extract images from pdf in c/c++ use 'pdfimages -all sample.pdf /tmp/output' for Extracts images in their original format. And -j flags for Extracts images in JPEG format. after extracting images you can use poppler library of c to extract text from that images.