javascriptvbaadobeacrobatjsobject

Adding textbox in whitespace to Abobe Acrobat PDF using JS and VBA


I'm trying to add a textbox into an Adobe Acrobat pdf using jsObject (being called from vba script). It needs to be as close to the top right of the page as possible without overlapping with any previously added text/tables. Any suggestions on how to accomplish this? Is there a way to determine the "hit box" of each object on the pdf so I know where the textbox cannot be?

Thanks!

Its not letting me copy and paste so here is an image of my code so far that puts a textbox onto the desired pdf Image of code


Solution

  • I've Determined that this is not possible. Instead I'm using VBA ImageProcess and ImageFile objects along with the Img.ARGBData property (color of individual pixels) and analyzing this in order to find white space then when a white space that is big enough is found replacing those pixels with the pixels desired.