if (i % 2 == 0)
checker_bytes[i] = 0;
else
checker_bytes[i] = (byte)255;
}
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);