}
ImageDef imgdef = doc.image_definition();
imgdef.data(checker_bytes, img_dim * img_dim);
imgdef.dimensions(img_dim, img_dim);
imgdef.color_space(ColorSpaceType.CS_DEVICE_GRAY);
imgdef.bits_per_component(8);
imgdef.dpi(9, 9);
imgdef.format(ImageFormat.IMAGE_FORMAT_NATIVE);
Image img_custom = doc.image_load(imgdef);
canvas.image(img_custom, 50, 310);
//