I need to know the library which helps to parse the structured pdf in order to collect the contained text and boxes as data dictionary. With the collected data dictionary i would like manipulate them and rewrite the pdf. I'm advised to use the Ghostscript, but i'm not sure how this can help me as this is an interpreter for the postscript. Can someone please help me to move on the right direction.
Ghostscript parses PDF files as well as interpreting PostScript. In fact the PDF interpreter is written in PostScript.
Because the PDF interpreter is a PostScript program you could, in theory, use it to achieve what you want but frankly it's not a great idea. The PDF interpreter program is highly complex and you would need to be a skilled PostScript programmer to alter it usefully.