Insert jpg at placeholder position in PDF doc

Hi

I have the requirement to insert an image at a specific position on a PDF document. The position can change, so am exploring options of ways to identify the position and insert the image.

One concept I'm exploring is whether I can put a tag/placeholder of sorts at the position I would like the image to be inserted eg <#InsertImage#>

Then use the PDF class to find the tag, get it's coordinates and then insert the image over the top.

Do you think this is possible?

Am open to other suggestions on how to best provide a solution too.

Thanks

1 Reply

KC Karthikeyan Chandrasekar Syncfusion Team September 17, 2018 11:07 AM UTC

Hi Damien, 
Thank you for your interest in Syncfusion products. 
If you know the size of the image in prior, you may use the below approach. 
  1. Have a template PDF with the image as place holder of your desired size and location.
  1. Then replace the image by using the below code
  1. The output image will draw within the bounds of the old image.

If the size of the image will be dynamic, use the below approach. 
  1. For place holder use some removable content, like Form fields
  1. Get the location of the Form field by using the below code snippet.
loadedTextBoxField.Bounds 
  1. Draw the image using the below code snippet with the desired size.

Please let me know if you need any further assistance. 
Regards, 
Karthikeyan 


Loader.
Up arrow icon