ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Pablo Rodriguez via ntg-context <ntg-context@ntg.nl>
To: "Michal Vlasák via ntg-context" <ntg-context@ntg.nl>
Cc: Pablo Rodriguez <oinos@gmx.es>
Subject: Re: JavaScript in multimedia PDF
Date: Mon, 9 Aug 2021 08:32:01 +0200	[thread overview]
Message-ID: <ec9bad10-d5d6-6dd3-a7d6-7487e4433f86@gmx.es> (raw)
In-Reply-To: <CDEFMBFFF77U.3PFSB801RVQ1D@phobos>

On 8/8/21 11:00 PM, Michal Vlasák via ntg-context wrote:
> On Sun Aug 8, 2021 at 8:22 PM CEST, Pablo Rodriguez via ntg-context wrote:
>> I don’t know why I get the following message:
>>
>> TypeError: a.doc is undefined
>>
>> It seems to be caused by "app.media.openPlayer", but the code is copied
>> from the documentation Adobe released early this year.
>
> Is there a newer document than "JavaScript for Acrobat API Reference"
> (May 2015)?

Well, the link you provided
(https://mailman.ntg.nl/pipermail/ntg-context/2021/103023.html) is from
February 2021:

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsapiref.pdf

Here is the guide to developers (from the same date):

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/pdfs/acrobatsdk_jsdevguide.pdf

> Anyways, I thought that the culprit is that you only specify the
> rendition (what to play) and not screen (where to play):
>
>
>      function GoToFirstSlide(label) {
>      this.pageNum = 0 ;
>      var rendition = this.media.getRendition(label) ;
>     +var screen = this.media.getAnnots({ nPage: 0})[0];
>      var player = app.media.openPlayer({
>          rendition: rendition,
>     +    annot: screen,
>        });
>      }
>
> But as it turns out, while the screen query succesfully returns an
> object, the rendition query returns null.
>
> The PDF 1.7 standard specifies that the name (/N) of Rendition PDF
> object should be Unicode, but that doesn't seem to make it work either,
> as does deleting the name of the media clip (which was the same).
>
> (But I now get "Invalid arguments" error for the "app.media.openPlayer"
> call, which is kind of expected.)
>
> Can you confirm, that "rendition" is null on your side as well?
>
>     console.println(rendition);
>     console.println(screen);
>     console.show();

I get exactly the same results: screen object, but null rendition.

I have no idea what it is needed here.

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-08-09  6:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-08 18:22 Pablo Rodriguez via ntg-context
2021-08-08 21:00 ` Michal Vlasák via ntg-context
2021-08-09  6:32   ` Pablo Rodriguez via ntg-context [this message]
2021-08-10 21:52     ` Michal Vlasák via ntg-context
2021-08-11 13:59       ` Pablo Rodriguez via ntg-context
2021-08-11 20:40         ` Michal Vlasák via ntg-context
2021-08-11 22:55           ` Hans Hagen via ntg-context
2021-08-12  1:02             ` Michal Vlasák via ntg-context
2021-08-12 14:36               ` Pablo Rodriguez via ntg-context

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec9bad10-d5d6-6dd3-a7d6-7487e4433f86@gmx.es \
    --to=ntg-context@ntg.nl \
    --cc=oinos@gmx.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).