Welcome Guest Search | Active Topics | Sign In | Register

Add Image to Existing Document Options
Sara
Posted: Wednesday, January 21, 2015 4:27:53 PM
Rank: Member
Groups: Member

Joined: 6/22/2011
Posts: 22
Hi. I am working on a project to add a signature image to existing pdf documents. The image is a bitmap. I have figured out how to add an image using PdfImage and PdfImageContent and know how to use the GfxMatrix.Translate method to set the image location on the document. However, I need to be able to determine, in code, the actual X,Y values to pass to the Translate method.
I have control over the creation of the these documents, so, yes, I could hard-code the X,Y coordinates. However, we will have multiple documents and I don't want to hard code the coordinates for each and every one. Is there some setting I could add to the documents that the code could find to determine the placement? Is there a way to get the coordinates of a particular field on the pdf document and do an offset from there? Is there a way to set a Field value to be an image?
eo_support
Posted: Wednesday, January 21, 2015 7:27:15 PM
Rank: Administration
Groups: Administration

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

EO.Pdf can not read the location of a specific field in an existing PDF. So if you are talking about existing PDF files, then the answer is no, you can not find out the location programmatically. The only case where you can find out the location programmatically is if your PDF file is created using EO.Pdf HTML to PDF converter. EO.Pdf HTML to PDF converter can return the exact location of a given HTML element. To use that feature, you will need to take the HtmlToPdfResult object returned by HtmlToPdf.ConvertHtml/ConvertUrl method, then use one of HtmlToPdfResult.HtmlDocument's method to return an HtmlElement object. The HtmlElement object has properties for you to get the location of that element.

Thanks!
Sara
Posted: Thursday, January 22, 2015 8:06:57 AM
Rank: Member
Groups: Member

Joined: 6/22/2011
Posts: 22
Thanks for the reply! I am talking about existing pdf files and am not creating these using the Html to PDF converter. This is, truthfully, the answer I expected, so I will need to store the coordinates for each of my documents. I was just hoping there would be some marker in the pdf file itself that I could use.
eo_support
Posted: Thursday, January 22, 2015 12:22:55 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,072
Sorry that we do not have what you wanted this time. Please feel free to let us know if you have any other questions.

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.