Welcome Guest Search | Active Topics | Sign In | Register

inserting an image over a PDF form textbox Options
ron
Posted: Wednesday, June 29, 2016 1:43:34 AM
Rank: Newbie
Groups: Member

Joined: 6/24/2016
Posts: 2
How would one get the position and size of a PdfField to place an image over this field? I'm attempting to place a signature gif on top of a PdfField.

Dim doc As New PdfDocument(pdfFileName)

'Load the image
Dim image As System.Drawing.Image = System.Drawing.Image.FromFile("c:\signature.gif")

'Create a new PdfImage object
Dim pdfImage As New EO.Pdf.Drawing.PdfImage(image)

'Create a new PdfImageContent object
Dim content As New EO.Pdf.Contents.PdfImageContent(pdfImage)

'Get the signature field
Dim field As PdfField = doc.Fields("signature")

'Can set the field value
field.Value = "John Smith"

'but how do you get its position and size so one can place the signature image over this field?

'Move the image on top of the pdf form signature text field
content.GfxMatrix.Translate(?, ?)

'Scale the image (is this necessary?)
content.AutoScale()

'Get the first page
Dim FirstPage As PdfPage = doc.Pages(0)

'Place the image on the page
firstpage.Contents.Add(content)

'Save it to a new file
doc.Save(newFileName)
eo_support
Posted: Wednesday, June 29, 2016 10:05:21 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,080
Hi,

Currently there is no way to get the position of a PdfField. You can only change its value. Sorry about it!

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.