with this code you can create file with pdf extension but you dont follow of PDF structure.you must use pdf libraries for read and write PDF files. you can find some libraries in following links:
http://schmidt.devlib.org/java/libraries-pdf.html
http://java-source.net/open-source/pdf-libraries