Method: Origami::PDF#onDocumentOpen
- Defined in:
- lib/origami/catalog.rb
#onDocumentOpen(action) ⇒ Object
Sets an action to run on document opening.
- action
-
An Action Object.
68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/origami/catalog.rb', line 68 def onDocumentOpen(action) unless action.is_a?(Action) or action.is_a?(Destination) or action.is_a?(Reference) raise TypeError, "An Action object must be passed." end unless self.Catalog raise InvalidPDFError, "A catalog object must exist to add this action." end self.Catalog.OpenAction = action self end |