1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

[api-minor] Add basic support for Launch actions (issue 1778, issue 3897, issue 6616)

In general we neither want, nor can, support arbitrary `Launch` actions. But in practice, all the cases we've seen so far just contains relative URLs to other PDF files. Building on PR 7689, we can thus at least support basic `Launch` actions.
This commit is contained in:
Jonas Jenwald 2016-10-21 13:29:15 +02:00
parent 7e392c0205
commit 2b79782377
3 changed files with 49 additions and 0 deletions

View file

@ -171,6 +171,7 @@ var Catalog = (function CatalogClosure() {
var outlineItem = {
dest: data.dest,
url: data.url,
unsafeUrl: data.unsafeUrl,
newWindow: data.newWindow,
title: stringToPDFString(title),
color: rgbColor,
@ -644,6 +645,12 @@ var Catalog = (function CatalogClosure() {
dest = action.get('D');
break;
case 'Launch':
// We neither want, nor can, support arbitrary 'Launch' actions.
// However, in practice they are mostly used for linking to other PDF
// files, which we thus attempt to support (utilizing `docBaseUrl`).
/* falls through */
case 'GoToR':
var urlDict = action.get('F');
if (isDict(urlDict)) {