Open Document Action

Open Document Action

Forum member · May 4, 2011
I am trying to create a link on a PDF that will open another pdf file without opening another window. I have managed to use the javascript action like this: var action = new JavaScriptAction(string.Format("app.openDoc('{0}.pdf', this); this.closeDoc(true);", rowNum)); This works pretty well except that it always opens a new window each time. I have tried using the javascript property: app.openInPlace = true; This does not seem to work as one would hope. I did notice that when importing a pdf with the Merger you can get an ImportedAction object which gives you the type, using the ActionType property. And, one of the types is GoToRemote, which I think is what I need but I don't know how to create an action of that type using the Generator. I thought it might be possible to create a custom action class by inheriting the base class Action so that I might implement my own action class. But, I do not know enough about the PDF specifications to do so. Does anyone have any ideas on what I might be able to do? Thanks in advance.

Re: Open Document Action

Support · May 6, 2011
Hello, According to the Adobe JavaScript specification app.openInPlace = true should open the document in the same window, although this might not be applicable in the case when the document is opened in the browser. Using the ImportedAction object you can check the action type of the action object in the existing PDF but you will not be able to instantiate the ImportedAction object. When you create a custom class by inheriting from the Action class it is not possible to set the action type as there is no property exposed in the base class for action type. Thanks, ceTe Software Support Team.

Re: Open Document Action

Forum member · Sep 3, 2012
Hi, how to create link/hyperlink in pdf document using javascript? thanks yashwant

Re: Open Document Action

Support · Sep 3, 2012
Hello Yashwant, You can add links and hyper links to the PDF document using Link page element and setting the XYDestination and UrlAction actions to it using Action classes. You can only add JavaScriptAction to the PDF using JaveScriptAction class. Thanks, ceTe Software Support Team.