Hi Manolo,
Thank you for contacting Syncfusion support.
We do have support for adding the action in a existing PDF document in Net Core. We have created a sample to add the JavaScript Action in existing PDF document. We have attached the sample with output document for your reference. Please try the below sample on your end and let us know the result.
Please refer the below code snippet for adding JavaScript Action in existing PDF document,
FileStream doc = new FileStream("../../../Input.pdf", FileMode.Open, FileAccess.Read);
//Load a PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(doc);
//Add the javascript action in a pdf document.
loadedDocument.Actions.AfterOpen = new PdfJavaScriptAction("app.alert(\"Modified Script!\")");
FileStream file = new FileStream("../../../Output.pdf", FileMode.Create, FileAccess.Write);
loadedDocument.Save(file);
loadedDocument.Close(true); |
Note: We are creating the UG documentation for this and we will update the details once it is reflected in live.
Please let us know if you need any further assistance with this.
Regards,
Gowthamraj K