Rank: Newbie Groups: Member
Joined: 5/23/2017 Posts: 4
|
I want to add a "signature" (png image) to an existing PDF file. Just paste this image in constant position on each page in given PDF.
Is it possiable to do it with EO.Pdf? If yes, how?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, Yes. You can either use the PDF creator interface or HTML to PDF feature to do that. The following code shows you how to do this with HTML to PDF:
Code: C#
//Load the PDF file
PdfDocument doc = new PdfDocument(your_existing_pdf_file_name);
//Format the HTML that positions the image
string html = string.Format(
"<img style='position:absolute;left:{0};top:{1};' src='file:///{2}'" />",
x_pos, //x position in pixel
y_pos, //y position in pixel
image_file_name //the full path of the image file
);
//Output the image to a specific page, here page_index is the index
//of the page on which you want the image to be added
HtmlToPdf.ConvertHtml(html, doc.Pages[page_index]);
You can also use the PDF creator interface if you prefer. You can take a look of the documentation and samples on how to use that. Hope this helps. Please let us know if you still have any questions. Thanks
|