I have a lot of PDFs with consistent content. I want to be able to run a script over them to delete particular content elements i.e. images, text blocks and lines. Is there a way to script this process? How do you access content elements through the scripting API?
You don't. JS only has access to the textual elements in a file (as well as things such as form fields, annotations, OCGs, links, etc.)
So unless these items always appear in the same sport on the page or can be identified using some text then you can't do it.