'Add Javascript which will launch upon opening this PDF.
:param str javascript: Your Javascript.
>>> output.addJS("this.print({bUI:true,bSilent:false,bShrinkToFit:true});")
# Example: This will launch the print window when the PDF is opened.'

def addJS(self, javascript):

    js = DictionaryObject()
    js.update({NameObject('/Type'): NameObject('/Action'), NameObject('/S'): NameObject('/JavaScript'), NameObject('/JS'): NameObject(('(%s)' % javascript))})
    js_indirect_object = self._addObject(js)
    js_string_name = str(uuid.uuid4())
    js_name_tree = DictionaryObject()
    js_name_tree.update({NameObject('/JavaScript'): DictionaryObject({NameObject('/Names'): ArrayObject([createStringObject(js_string_name), js_indirect_object])})})
    self._addObject(js_name_tree)
    self._root_object.update({NameObject('/OpenAction'): js_indirect_object, NameObject('/Names'): js_name_tree})
