Placing an image on PDF, merging PDF pages.

Q; Using ElementBuilder as a guide, having got the general idea to
make sure I could have one common application that could make PDF's or
print directly.

The images are giving me fits. the whole PDF matrix is beyond what I
want to learn. If you could spare me the time to have to learn
2DMatrix, I would appreciate it.

Question 1:

In Windows, the simplified code would be this:

Bitmap bitmap = new Bitmap("peppers.jpg");
e.Graphics.DrawImage(bitmap, 60, 10);

e.Graphics.DrawImage(bitmap, 60, 10, width, height);/// stretches
to another size

In PDFTron, the simplified code to format a Windows image of the same
into a PDF would be this
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap("peppers.jpg" );
pdftron.PDF.Image img = pdftron.PDF.Image.Create(Document, bmp);
Element element = theElementBuilder.CreateImage(img, new

expand the bitmap to larger/smaller width-height starting at the same

Question 2:

On the Windows graphic side, I just lifted the code from PDFPrint and
put it
in my C# code to include a PDF into the printed documents. Works like
a champ. Both in ancient 1995 C program and the new C# version.

On the PDF side I need to do the same thing. If you could point me to
how to
read one or more pages from an existing PDF and include it in a
ElementBuilderTest, I would be very
A: Re: Q1) You may want to use:

Element element = theElementBuilder.CreateImage(img, new Matrix2D
(width, 0, 0, height, 60, 10));

where 60, 10 is the horizontal/vertical offset (similar to GDI+ code).

Re Q2:

If you simply want to copy some pages from one document to another you
could use pdfdoc.PagePushBack(page)/PagePushFrom(page)/PageInsert(idx,
page) as illustrated in PDFPage sample project (also you may want to
read through

If you need to add content to an existing PDF document, you could
simply open the PDF file, get the required page and start adding the
content (for a concrete example, please take a look at

Thanks, both are done and seem easy now.

I have to rework my text building on the PDF side to handle multiple
fonts in one paragraph and I am done.

As I learn more about PDFTron, I can see other applications of that
production in our product.

Moving pages around from one PDF to another is something we have been
asked to do for months.

Now I can do it!