protected internal void SetJavaScript()
{
Dictionary<string,PdfObject> djs = pdf.GetDocumentLevelJS();
if (djs.Count == 0)
return;
PdfDictionary catalog = reader.Catalog;
PdfDictionary names = (PdfDictionary)PdfReader.GetPdfObject(catalog.Get(PdfName.NAMES), catalog);
if (names == null) {
names = new PdfDictionary();
catalog.Put(PdfName.NAMES, names);
MarkUsed(catalog);
}
MarkUsed(names);
PdfDictionary tree = PdfNameTree.WriteTree(djs, this);
names.Put(PdfName.JAVASCRIPT, AddToBody(tree).IndirectReference);
}