PDF2Image

The following code converts the given PDF file into a Image file of a given Image type.

import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.ByteBuffer;

import javax.imageio.ImageIO; import com.sun.pdfview.PDFFile; import com.sun.pdfview.PDFPage;

public class PdfToImage {

    public void convert(String pdfFileName, String type) {         try . . . → Read More: PDF2Image