pdfdoc = PDFDoc.new()
Convert.ToPdf(pdfdoc, input_file_path)
pdfdoc.Save(output_file_path, SDFDoc::E_compatibility)
You could run PDF/A Converter (pdftron.PDF. PDFA.PDFACompliance – as shown in PDF/A sample https://www.pdftron.com/pdfnet/samplecode.html#PDFA). PDF/A conversion will automatically remove JavaScript and embedded files (for pdf/a 1 & 2 compliance).
Alternatively you would need to write code that would strip away JavaScript, Embedded Files etc.
Obj names = doc.GetRoot().FindObj("Names")
if (names != null)
{
names->Erase("EmbeddedFiles");
names->Erase("JavaScript");
}
You would also need to traverse all actions in the doc (e.g. associated with Annotations) removing any JavaScript actions etc.
Depending on full list of requirements this may or may not be simple. Since PDF/A is designed to take care of these things, PDFACompliance would be the simplest to use.