Q: We are trying to insert an image to a pdfform in a particular
position.
From the sample code (
http://www.pdftron.com/net/
samplecode.html#AddImage), I know, we can insert an image to a new
page. But now the problem is, the image needs to be inserted into a
existed page in a particular position. our idea is that we give a
filed in that position, and by coding to insert the image in that
position dynamically. Can you please advise how?
----
A: Adding an image (or other content) to an existing PDF page is
exactly the same as adding an image to a blank new page (e.g. see
http://www.pdftron.com/net/faq.html#how_watermark).
The only difference is how you retrieve the page that you pass in the
call to ElementWriter.Begin(page). In case of the exiting PDF page you
would use pdfdoc.GetPage(num) to fetch the page; in case of a new page
you would use pdfdoc.PageCreate() and pdfdoc.PageInsert() to create
and position the page.
Unless you really need to deal with AcroForms it is probably simpler
to place the image directly (without any relevance to forms).