Read document level javascripts

Is there a way to read the document level javascripts from a pdf?

For example, you have something like this;

/*********** belongs to: Document-Level:MyDocumentFn ***********/
function someJS() {}

Can you read this javascript with Aspose.PDF?
Or maybe just get a string dump of all the javascripts like “Edit All Javascripts” in Acrobat Pro?

Hi Kevin,

Thanks for contacting support.

Currently Aspose.Pdf for .NET supports the feature to add or remove JavaScript from PDF file but it does not support the feature to get/read all JavaScript from PDF document. However for the sake of correction, we already have logged this requirement as PDFNEWNET-38836. We will further look into the details of this requirement and will keep you posted on the status of correction. please be patient and spare us little time. We are sorry for this inconvenience.

Meanwhile you may consider looking over following links for information on

  • [Adding JavaScript (DOM)](
  • [Create JavaScript Link in Existing PDF File (Facades)](

Code to trim JavaScript from PDF file.


// strip JavaScript from PDF file<o:p></o:p>

PdfJavaScriptStripper oldpjs = new PdfJavaScriptStripper();


Yes, I have a requirement for reading the existing JavaScript. Please let me know if/when this becomes possible with Aspose.Pdf.

Hi Kevin,

As shared earlier, the feature of reading existing JavaScript is currently not supported. However its been logged in our issue tracking system as PDFNEWNET-38836. I am afraid currently we cannot share the timelines by which it will be resolved, however as soon as we have some definite updates regarding its resolution, we will update you within this forum thread. Please be patient and spare us little time.

Hello Aspose Team,
Has the feature to read all existing JavaScript been implemented? I need this for my use case.


Regretfully the feature is not yet implemented. However, we will surely inform within this forum thread as soon as it is available. Please spare us some time.

We are sorry for the inconvenience.