i want to create one pdf file and write something to it by servlet. i write this code:
DataOutputStream dos = new DataOutputStream(new FileOutputStream("c:\\file.pdf"));
dos.write("This is a test of the FileWriter class.\n");
dos.close();
and i also exam this code:
FileWriter fw = new FileWriter("c:\\test.pdf");
fw.write("This is a test of the FileWriter class.\n");
fw.close();
and also printwriter and printstream. file properly create but when i want to open file i encounter with one error that say this file is cottupt and ....