Commit 6f69595f authored by Pino Toscano's avatar Pino Toscano

Optionally convert JavaScript links and read top level JS scripts from Poppler.

Requires the development version.

svn path=/trunk/KDE/kdegraphics/okular/; revision=796640
parent 513c7cf2
......@@ -141,6 +141,9 @@ static Okular::Action* createLinkFromPopplerLink(const Poppler::Link *popplerLin
const Poppler::LinkBrowse *popplerLinkBrowse;
const Poppler::LinkAction *popplerLinkAction;
const Poppler::LinkSound *popplerLinkSound;
#ifdef HAVE_POPPLER_0_9
const Poppler::LinkJavaScript *popplerLinkJS;
#endif
Okular::DocumentViewport viewport;
switch(popplerLink->linkType())
......@@ -178,6 +181,15 @@ static Okular::Action* createLinkFromPopplerLink(const Poppler::Link *popplerLin
}
break;
#ifdef HAVE_POPPLER_0_9
case Poppler::Link::JavaScript:
{
popplerLinkJS = static_cast<const Poppler::LinkJavaScript *>(popplerLink);
link = new Okular::ScriptAction( Okular::JavaScript, popplerLinkJS->script() );
}
break;
#endif
case Poppler::Link::Movie:
// not implemented
break;
......@@ -897,6 +909,12 @@ QVariant PDFGenerator::metaData( const QString & key, const QVariant & option )
if ( pdfdoc->pageMode() == Poppler::Document::UseOutlines )
return true;
}
#ifdef HAVE_POPPLER_0_9
else if ( key == "DocumentScripts" && option.toString() == "JavaScript" )
{
return pdfdoc->scripts();
}
#endif
return QVariant();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment