We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

PdfJavaScriptStripper.Strip returns true for document without JavaScript

Hi, Aspose team,

I have question about PdfJavaScriptStripper class and Strip method. When I remove all JavaScript from PDF document, which actually contains JavaScript, PdfJavaScriptStripper().Strip(doc1, doc2) returns true.
However when I pass cleaned document to Strip method, it returns true again, but I expect false, because JavaScript was already removed.

In case, when I pass document without JavaScript at all, method returns false for original document and false for cleaned document (what is correct).

Use the following code and sample.pdf (11.8 KB) to replicate issue:

new Aspose.Pdf.License().SetLicense(<license path>);

var original = <original document>;
var oneClean = original + ".1.pdf";
var twoClean = original + ".2.pdf";

var expectedTrue = new PdfJavaScriptStripper().Strip(original, oneClean);
var expectedFalseButTrue = new PdfJavaScriptStripper().Strip(oneClean, twoClean);

Best regard,
Alex Shloma.

@licenses

We were able to observe the issue in our environment using Aspose.PDF for .NET 19.3 and logged it as PDFNET-46236 in our issue tracking system. We will check this behavior of the API and investigate the issue in details. We will keep you informed with the status of its rectification. Please be patient and spare us little time.

We are sorry for the inconvenience.