The examples make use of a function named AddImagePage. This
function simply creates an appropriate Doc object, adds the image
and returns the ImageLayer which was added.
private ImageLayer AddImagePage(Doc doc, string path) {
using (XImage img = XImage.FromFile(path, null)) {
doc.MediaBox.SetSides(0, 0, img.Width, img.Height);
doc.Page = doc.AddPage();
doc.Rect.String = doc.MediaBox.String;
int id = doc.AddImageObject(img);
return (ImageLayer)doc.ObjectSoup[id];
}
}