You can't create a PDf file by creating a text file and giving it a .pdf extension. You need to use a library like iText. The simplest Java program that can create PDF files is something like this.
Don't get me started about those stupid light bulbs.