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

Free Support Forum - aspose.com

Remove LaunchAction java pdf

Hi,
I am trying to remove LaunchAction from a pdf file. I am able to get it:
IAppointment act = document.getOpenAction();
but not delete it.
Thanks,

Hi Camille,


Thanks for contacting support.

Please share the resource PDF file and code snippet, so that we can test the scenario at our end. We are sorry for this inconvenience.

Hello,
Attached is the file. Here is the code I have:

try {
Document document = new Document(new FileInputStream(“LaunchAction.pdf”));
} catch (FileNotFoundException e1) {
e1.printStackTrace();
}
IAppointment act = document.getOpenAction();

Then, I am not sure how to delete it. I looked for a delete funciton in IAppointment or a deleteOpenAction in document but could not find either. I would like to do the same as in https://docs.aspose.com/pdf/net/actions/#remove-document-open-action-from-a-pdf-file but with java.

Thank you.

Hi Camille,


Thanks for sharing the details. Please not you need to remove any action you need to set it to null. Please check following code snippet for the purpose. Hopefully it will help you to accomplish the task.

// Open document<o:p></o:p>

Document document = new Document(myDir+"LaunchAction.pdf");

// Remove document open action

document.setOpenAction(null);

// Save updated document

document.save(myDir+"LaunchAction_output.pdf");


Please feel free to contact us for any further assistance.


Best Regards,