Hello I am trying to use PdfJavaScriptStripper and get the following error.
Code:
PdfJavaScriptStripper jsStriper = new PdfJavaScriptStripper();
InputStream targetStream = new FileInputStream(f);
OutputStream os = new FileOutputStream(f.getAbsolutePath());
stripSucess = jsStriper.strip(targetStream, os);
File f is a pdf file and I want to remove the js and save it to the same location.
The output is:
" class com.aspose.pdf.exceptions.InvalidPdfFileFormatException: Incorect file format"
- How to solve this issue?
- Do you have simpler way to remove all Js
- How can I check if a document has JS