DOC and PPT are supported by the Apache POI library, while for PDF there's iText. These are sizeable APIs, though - the code would have to deal with pages (or slides), paragraphs etc. See the iTextExample and CreateWordDocument samples in http://faq.javaranch.com/java/CodeBarnLibrariesAndFrameworks for an idea of how those libraries work.