Re: [NTG-context] multimedia PDF in ConTeXt

2021-07-30 Thread Michal Vlasák via ntg-context
On Fri Jul 30, 2021 at 8:53 PM CEST, Pablo Rodriguez via ntg-context wrote:
> Hi Michal and Hans,
>
> many thanks for your patch to fix multimedia objects in PDF and your
> extremely interesting and in-depth explanation about multimedia in PDF.
> Many thanks to Hans for the release of an updated latest with also
> updated documentation.

By the way, Pablo, your issue
https://www.mail-archive.com/ntg-context@ntg.nl/msg88204.html was also
solved in the last upload. Unfortunately it will probably not help you,
because Acrobat no longer supports this.

\useexternalsoundtrack
  [myaudio][audio.mp3]

\checksoundtrack{myaudio}

\goto{PLAY SOUND}[StartSound{myaudio}]


But, you can use renderings instead:

\useexternalrendering[myaudiorendering]
  [audio/mp3][audio.mp3][embed=yes]

\definerenderingwindow[audiowindow]
  [width=0sp, height=0sp]

\definelayer[resources]
\setupbackgrounds[page][background=resources]
\setlayer[resources]{\placerenderingwindow[audiowindow][myaudiorendering]}

\goto{PLAY SOUND}[StartRendering{myaudiorendering}]


This is basically the example from "/back-swf.mkiv". Works in Acrobat.
And one can use either of the three possible file methods (embedded,
external, URL), not just external files. The layer is so that the empty
frame doesn't interfere with normal page content. No frame is drawn when
both dimensions are 0, not sure if that is a behaviour one can take as
granted. But currenntly the dimensions can't be zero.

Hans, I would omit the check for 0 dimensions of rendering window (as
already noted in the source, it is useful for sound). See patch below.

Michal Vlasák

--- a/tex/context/base/mkxl/lpdf-wid.lmt
+++ b/tex/context/base/mkxl/lpdf-wid.lmt
@@ -655,9 +655,6 @@ local function insertrenderingwindow(specification)
 }
 local width = specification.width or 0
 local height = specification.height or 0
-if height == 0 or width == 0 then
--- todo: sound needs no window
-end
 context(nodeinjections.annotation(width,height,0,d(),r)) -- save ref
 return pdfreference(r)
 end
___
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
___


Re: [NTG-context] Strange new behaviour of the mailing list

2021-07-30 Thread Henning Hraban Ramm via ntg-context

> Am 31.07.2021 um 00:05 schrieb Bruce Horrocks via ntg-context 
> :
> 
> On 30 Jul 2021, at 22:24, Otared Kavian via ntg-context  
> wrote:
>> 
>> Hi all,
>> 
>> I noticed that beginning July 27th, the messages distributed by the ConTeXt 
>> mailing list appear to be from
>> 
>>  Mailing list for ConTeXt users
>> 
>> without the actual name of the sender appearing.  ...
> 
> I see the same thing, also on Macos. Looking at an older message, I see that 
> the Reply-To: header has changed from
> 
> Reply to: Bruce Horrocks ,
>  mailing list for ConTeXt users 
> 
> to
> 
> Reply to: mailing list for ConTeXt users 

If you click on that name, you can see the actual address.

Hraban
___
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
___


Re: [NTG-context] Verbatim text in a frame

2021-07-30 Thread Hans Hagen via ntg-context

On 7/30/2021 9:12 PM, Jeroen via ntg-context wrote:
I am using the following preamble to put a frame around verbatim text. 
How can I have all the text start some 5pt from the frame and how can I 
get rounded corners, corner=0 does not seem to work




\setupcolors[state=start]

\setupcolor[xwi]

\definetextbackground
   [Code]
   [frame=on,
    framecolor=black,
    %corner=0,
    %offset=10pt,
    background=color,
    backgroundcolor=gray,
    location=paragraph]

\setuptyping
   [before={\blank\starttextbackground[Code]},
    after={\stoptextbackground\blank}]

\starttext

\starttyping
example
\stoptyping

\stoptext

\definetextbackground
  [Code]
  [frame=on,
   framecolor=black,
   corner=round,
   radius=10pt,
   topoffset=10pt,
   leftoffset=5pt,
   background=color,
   backgroundcolor=gray,
   location=paragraph]


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] multimedia PDF in ConTeXt

2021-07-30 Thread Michal Vlasák via ntg-context
On Fri Jul 30, 2021 at 8:53 PM CEST, Pablo Rodriguez via ntg-context wrote:
> Hi Michal and Hans,
>
> many thanks for your patch to fix multimedia objects in PDF and your
> extremely interesting and in-depth explanation about multimedia in PDF.
> Many thanks to Hans for the release of an updated latest with also
> updated documentation.
>
> Although I don’t read Czech, just out of curiosity, is your bachelor
> thesis available on the net, Michal? Thanks to theses.cz, I found
> https://is.muni.cz/th/t8qpp/DP_Vlasak_Michal_2015.pdf (only a name
> coincidence, I guess).

Sorry, should have shared the link at the first place.

https://dspace.cvut.cz/handle/10467/95065

(PLNY_TEXT) links to the full text.

(PRILOHA) is almost all files I had for the thesis. Most notably the
testing files I used. (Some were handcoded, so no sources, but these
should be readable in text editors).

> Using your sample, I have two questions:
>
> \starttext
> \setupinteraction[state=start]
>
> \useexternalrendering[myvideo][video/mp4][video.mp4][embed=yes]
>
> \definerenderingwindow[myrenderingwindow]
> [width=\textwidth, height=\textwidth]
>
> \placerenderingwindow[myrenderingwindow][myvideo]
> \stoptext
>
> Is there no way to have the video as an embedded file in the PDF
> document? (I mean, that the file is listed when the attachment panel is
> displayed.)

Currently, only attachments are added as "embedded files" (either as
"hidden", ending up in /EmbeddedFiles, or as "annotation" ending up as
/FileAttachment annotation).

Maybe "codeinjections.embedfile" can have the option to force the
reference, so that the file also ends up in /EmbeddedFiles? Should it be
default for all \externalrenderings?

My try:

https://github.com/contextgarden/context-mirror/commit/681c36d0ecfd30c05ed588eb0f37a06dd19f3492

(the full file can be located by clicking on the three dots after the
file name, then "View file" and then "Raw", resulting in:

https://github.com/contextgarden/context-mirror/blob/681c36d0ecfd30c05ed588eb0f37a06dd19f3492/tex/context/base/mkxl/lpdf-wid.lmt,

Patch can be obtained by adding .diff to the URL:

https://github.com/contextgarden/context-mirror/commit/681c36d0ecfd30c05ed588eb0f37a06dd19f3492.diff

I will probably not keep the commit on GitHub forever, it just seems
like a nice way to send quick patches -- it is visual and allows full
file/patch download. So this time full patch also included below for
future reference.)

Michal


--- a/tex/context/base/mkxl/lpdf-wid.lmt
+++ b/tex/context/base/mkxl/lpdf-wid.lmt
@@ -259,7 +259,7 @@ local function flushembeddedfiles()
 for tag, reference in sortedhash(filestreams) do
 if not reference then
 report_attachment("unreferenced file, tag %a",tag)
-elseif referenced[tag] == "hidden" then
+elseif referenced[tag] == "hidden" or referenced[tag] == "forced" 
then
 e[#e+1] = pdfstring(tag)
 e[#e+1] = reference -- already a reference
 f[#f+1] = reference -- collect all file description references
@@ -369,6 +369,9 @@ function codeinjections.embedfile(specification)
 }
 local r = pdfreference(pdfflushobject(d))
 filestreams[hash] = r
+if specification.forcereference == true then
+referenced[hash] = "forced"
+end
 return r
 end
 end
@@ -705,9 +708,10 @@ local function insertrendering(specification)
 descriptor = pdfreference(pdfflushobject(descriptor))
 elseif option[v_embed] then
 descriptor = codeinjections.embedfile {
-file = filename,
-mimetype = mimetype, -- yes or no
-compress = false,
+file   = filename,
+mimetype   = mimetype, -- yes or no
+compress   = false,
+forcereference = true,
 }
 end
 local clip = pdfdictionary {
___
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
___


Re: [NTG-context] Strange new behaviour of the mailing list

2021-07-30 Thread Bruce Horrocks via ntg-context
On 30 Jul 2021, at 22:24, Otared Kavian via ntg-context  
wrote:
> 
> Hi all,
> 
> I noticed that beginning July 27th, the messages distributed by the ConTeXt 
> mailing list appear to be from
> 
>   Mailing list for ConTeXt users
> 
> without the actual name of the sender appearing. It may be dependent on the 
> mail client I am using (Mail.app on MacOS 11.4), but I wonder whether 
> something has changed on mailing list server, and whether if there is 
> something I can do to have the old behaviour (which was convenient when one 
> wanted to follow up mails from some specific contributors). 
> 
> Also has anybody else noticed this change?
> 
> Thanks in advance for any hint.
> Best regards: Otared

I see the same thing, also on Macos. Looking at an older message, I see that 
the Reply-To: header has changed from

Reply to: Bruce Horrocks ,
  mailing list for ConTeXt users 

to

Reply to: mailing list for ConTeXt users 


So I suggest that there is little you can do as it appears to be a 
configuration change on the mailing list server; and Apple Mail doesn't have 
the facilities to easily allow you to re-write that header

—
Bruce Horrocks
Hampshire, UK

___
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
___


[NTG-context] Strange new behaviour of the mailing list

2021-07-30 Thread Otared Kavian via ntg-context
Hi all,

I noticed that beginning July 27th, the messages distributed by the ConTeXt 
mailing list appear to be from

Mailing list for ConTeXt users

without the actual name of the sender appearing. It may be dependent on the 
mail client I am using (Mail.app on MacOS 11.4), but I wonder whether something 
has changed on mailing list server, and whether if there is something I can do 
to have the old behaviour (which was convenient when one wanted to follow up 
mails from some specific contributors). 

Also has anybody else noticed this change?

Thanks in advance for any hint.
Best regards: Otared
___
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
___


[NTG-context] Verbatim text in a frame

2021-07-30 Thread Jeroen via ntg-context
I am using the following preamble to put a frame around verbatim text. How
can I have all the text start some 5pt from the frame and how can I get
rounded corners, corner=0 does not seem to work



\setupcolors[state=start]

\setupcolor[xwi]

\definetextbackground
  [Code]
  [frame=on,
   framecolor=black,
   %corner=0,
   %offset=10pt,
   background=color,
   backgroundcolor=gray,
   location=paragraph]

\setuptyping
  [before={\blank\starttextbackground[Code]},
   after={\stoptextbackground\blank}]

\starttext

\starttyping
example
\stoptyping

\stoptext
___
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
___


[NTG-context] multimedia PDF in ConTeXt

2021-07-30 Thread Pablo Rodriguez via ntg-context
Hi Michal and Hans,

many thanks for your patch to fix multimedia objects in PDF and your
extremely interesting and in-depth explanation about multimedia in PDF.
Many thanks to Hans for the release of an updated latest with also
updated documentation.

Although I don’t read Czech, just out of curiosity, is your bachelor
thesis available on the net, Michal? Thanks to theses.cz, I found
https://is.muni.cz/th/t8qpp/DP_Vlasak_Michal_2015.pdf (only a name
coincidence, I guess).

Using your sample, I have two questions:

  \starttext
  \setupinteraction[state=start]

  \useexternalrendering[myvideo][video/mp4][video.mp4][embed=yes]

  \definerenderingwindow[myrenderingwindow]
[width=\textwidth, height=\textwidth]

  \placerenderingwindow[myrenderingwindow][myvideo]
  \stoptext

Is there no way to have the video as an embedded file in the PDF
document? (I mean, that the file is listed when the attachment panel is
displayed.)

The second question is addressed to Hans: would it be possible that
\placerenderingwindow could have another option and text as in \framed?
A workaround would be to add a layer, but too complex only for adding
usage instructions for the media usage.

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
___