import java.io.*; import java.util.*; import java.awt.image.*; import java.awt.geom.*; import java.awt.*; import javax.media.jai.*; import com.sun.media.jai.codec.*; import org.faceless.pdf2.*; // Quick and dirty example showing how to convert a PDF // to a TIFF class F file. // // Usage: java PDFToClassF file.pdf // Creates a file called "fax.tif" // public class PDFToClassF { static final float dpix = 204, dpiy = 196; public static void main(String[] args) throws Exception { PDF pdf = new PDF(new PDFReader(new File(args[0]))); PDFParser parser = new PDFParser(pdf); byte[] b = new byte[] { -1, 0 }; ColorModel model = new IndexColorModel(1, 2, b, b, b); BufferedImage[] images = new BufferedImage[pdf.getNumberOfPages()]; for (int i=0;i 1) { param.setExtraImages(Arrays.asList(images).subList(1, images.length).iterator()); } encoder.encode(images[0]); out.close(); } }