A question on embedding an image in PDF.

Q: I'm currently using PDFnet SDK and I have to say its extremely
robust and easy to use.

I'm encountering a problem when embedding a .png image into an
existing PDF. Although its embedding the image correctly it is
duplicating the page. The PDF is only one page in length but ends up
as two identical pages.

Here is the code:

            PDFDoc doc = new PDFDoc(DIRtextBox.Text + "\\" +
            ElementBuilder bld = new ElementBuilder();
            ElementWriter writer = new ElementWriter();
                Page page = doc.GetPage(1);
                string input_path = DIRtextBox.Text + "\\";

                Image img = Image.Create(doc, input_path +
                Element element = bld.CreateImage(img, new
Matrix2D(img.GetImageWidth() / 4, 0, 0, img.GetImageHeight() / 4, 0,
img.GetImageHeight() / 4));

                writer.End(); // Finish writing to the page

                doc.Save(input_path + "addimage.pdf",
A: The problem is that you are replicating the page using
To remove the extra page simply comment out this line.