code: public void drawImage (final PDImageXObject image,
                           final float x,
                           final float y,
                           final float width,
                           final float height) throws IOException
    {
      if (inTextMode)
      {
        throw new IllegalStateException ("Error: drawImage is not allowed within a text block.");
      }
  
      saveGraphicsState ();
  
      final AffineTransform transform = new AffineTransform (width, 0, 0, height, x, y);
      transform (new Matrix (transform));
  
      writeOperand (resources.add (image));
      writeOperator ((byte) 'D', (byte) 'o');
  
      restoreGraphicsState ();
    }
docs: Draw an image at the x,y coordinates, with the given size.
  
  @param image
  The image to draw.
  @param x
  The x-coordinate to draw the image.
  @param y
  The y-coordinate to draw the image.
  @param width
  The width to draw the image.
  @param height
  The height to draw the image.
  @throws IOException
  If there is an error writing to the stream.
  @throws IllegalStateException
  If the method was called within a text block.