Java Action Failed

Hi All, I have created one java action to Remove the last pages in pdf i have written something like this it is running successful and returning true but page is not getting removed     my code is  Thanks in Advance
1 answers

You’d pass the FileDocument as a parameter to your Java Action when you call it from a microflow. This will be exposed in the Java Action. WSo if you called the parameter “TheFileDocument” it should be available as this.TheFileDocument in the Java Action. You would use this instead of “filedocument”, for example…

IContext context = getContext();

PDDocument inputDoc = PDDocument.load(Core.getFileDocumentContent(context, this.TheFileDocument.getMendixObject()));

return inputDoc.getNumberOfPages();

Hope this helps