How to programmatically add rectangle to a pdf file ?
There is several page pdfs, non-vector, black and white.
Users are color blind and have disabilities.
To train them, one adds a rectangle at a certain lower-left point and width,height specified for a page.
The idea is to give the script the page and coordinates and size of rectangle to be added programmatically. Green rectangles are acceptable as the cones are most sensitive there.
Also, additional feature to add bookmarks on the left in the order these rectangle data is provided to the script.
The script could be "hard-wired" by a list of the rectangle coodinates, and page number, pasted inside acrobat and run or entered into acrobat in some way.
Your script would help many disabled people who are distributed through out the world.
Feel free to contact me by email if you wish.
This rectangle does not have to be a full annotation rectangle which needs user,date and a lot of info.
Something minimal like this would suffice
1 0 0 RG % red for stroke color
200 300 50 75 re
As you can see that the native unit of the pdf file is the "point" having 72 in an inch.
The file dpi would be given. However, one could assume that pixel for the rectangle lower-left and width/height are given.
From the pixels and dpi, the points could be calculated if desired.