I am getting a pdf in byte array. I want to convert just the 1st page of the pdf into image.
I have tired the classes provided by com
As far as I know this is not possible with iText (at least some time ago while I searched for a similar issue).
But you can use the PDFToImage from Apache PDFBox:
String [] args = new String[7];
args[0] = "-startPage";
args[1] = "1";
args[2] = "-endPage";
args[3] = "1";
args[4] = "-outputPrefix";
args[5] = "MyJpgFile";
args[6] = "MyPdfFile";
PDFToImage.main(args);
It's easy to write a wrapper for this. Perhaps such a wrapper is available in PDFBox in the meantime.