Sounds like you want to do this on a server, but you should know that Adobe Acrobat cannot legally be used on a server.
For server-based PDF operations you can look at Adobe LiveCycle products or our Adobe PDFLibrary (available in both Java and C++)