I want a tool or library that can extract the text in PDF documents so that it can be retained in a text document. Formatting does not need to be retained, though I would like to be able to recognize it so that I can determine sections of the document. (e.g. write a rule that says every instance of H1 is the start of a new section.) Also acceptable is something that extracts the PDF to a format like ODF or DOCx, which includes formatting and pictures.
Tools like PDFParser can only read text and only when the PDF is not protected.
Though free tools are preferred, I am also willing to pay.
If it matters, the project that would use this is written in PHP using Laravel.