public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
ImageRawCCITTFax ccitt = (ImageRawCCITTFax)image;
PDFDocument pdfDoc = (PDFDocument)context.getProperty(
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
PDFImage pdfimage = new ImageRawCCITTFaxAdapter(ccitt, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
float x = (float)pos.getX() / 1000f;
float y = (float)pos.getY() / 1000f;
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;