hi, i am implementing a action , change file to pdf , so there is need , to replace existing file or content and replace with new file Can anybody help me How it is possible?
Please read the docs and attempt to overwrite the file on your own. If you have trouble, come back with the stack trace and your source code so we can help you troubleshoot.
// get the PDF input stream and create a reader for iText PdfReader reader = new PdfReader(inputStream); stamp = new PdfStamper(reader, new FileOutputStream(file));
// encrypt PDF stamp.setEncryption(userPassword.getBytes(Charset.forName("UTF-8")), ownerPassword.getBytes(Charset.forName("UTF-8")), permissions, encryptionType); stamp.close();
Now i want to replace encrypted with existing File,How it is possible?Plz help me