code: protected void addImage(PdfContext context, ImageResult imageResult) throws BadElementException, IOException {
  		Bbox imageBounds = imageResult.getRasterImage().getBounds();
  		float scaleFactor = (float) (72 / getMap().getRasterResolution());
  		float width = (float) imageBounds.getWidth() * scaleFactor;
  		float height = (float) imageBounds.getHeight() * scaleFactor;
  		// subtract screen position of lower-left corner
  		float x = (float) (imageBounds.getX() - rasterScale * bbox.getMinX()) * scaleFactor;
  		// shift y to lowerleft corner, flip y to user space and subtract
  		// screen position of lower-left
  		// corner
  		float y = (float) (-imageBounds.getY() - imageBounds.getHeight() - rasterScale * bbox.getMinY()) * scaleFactor;
  		if (log.isDebugEnabled()) {
  			log.debug("adding image, width=" + width + ",height=" + height + ",x=" + x + ",y=" + y);
  		}
  		// opacity
  		log.debug("before drawImage");
  		context.drawImage(Image.getInstance(imageResult.getImage()), new Rectangle(x, y, x + width, y + height),
  				getSize(), getOpacity());
  		log.debug("after drawImage");
  	}
docs: Add image in the document.
  
  @param context
  PDF context
  @param imageResult
  image
  @throws BadElementException
  PDF construction problem
  @throws IOException
  PDF construction problem