Dear experts,
There are a lot of discussions on how to work with images in existing PDFs...
I cannot find a good answer on how to edit/delete text (
Annot) objects. For example:
Code:
40 0 obj
<</Type /Annot
/Rect [360.5339 484.7710 442.1034 494.7290]
/Border [0 0 0]
/Subtype /Link
/A <</Type /Action
/S /URI
/URI (http://www.adobe.com/products/acrobat/readstep2.html)>>>>
endobj
Inside the page object it's referenced:
Code:
...
/Annots [44 0 R 45 0 R 32 0 R 33 0 R 34 0 R 35 0 R 36 0 R 37 0 R 38 0 R 39 0 R 40 0 R 41 0 R 42 0 R 43 0 R]>>
...
I've tried to loop through the annotations by PdfArray.ArrayElements arr = page.Annotations.Elements; but can only get PdfItem object array, which is not giving me any way to, for example change the "/URI" of the object.
I want to be able to do something like:
Code:
if (xObject != null && xObject.Elements.GetString("/Subtype") == "/Link") {
xObject.Elements.SetString("/URI", "http://somethingelse.com");
}
Any suggestions