ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] viewer layers (optional content groups, OCG)
@ 2023-06-19 18:41 Henning Hraban Ramm via ntg-context
  2023-06-22 16:07 ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Henning Hraban Ramm via ntg-context @ 2023-06-19 18:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Henning Hraban Ramm

Checking viewer layers:

* \setupviewerlayer doesn’t work; e.g. "state=stop" only works if I put 
it in \defineviewerlayer
* visible=no has no effect
* what are the options tag/name supposed to do?
(https://wiki.contextgarden.net/Viewer_Layers)
* known problem: only Acrobat supports JS to control OCGs 
(\overlayrollbutton in the MWE)

Hraban


\setupinteraction[state=start]% needed for JS

\defineviewerlayer[Gebuesch][
   state=stop,
]
\defineviewerlayer[Versteck]
\setupviewerlayer[Versteck][ % doesn’t work
   state=stop,
]

\starttext
Hier fängt der Wald an.

\startviewerlayer[Gebuesch]
Hier versteckt sich ein Wolf...
\stopviewerlayer

Bäume, Bäume, Bäume...

\viewerlayer[Gebuesch]{... und ein Rotkehlchen}

\startviewerlayer[Versteck]Rumpelwicht\stopviewerlayer

\defineoverlay[MitVersteck]
[{\overlayrollbutton[VideLayer{Versteck}][HideLayer{Versteck}]}]

\framed[background=MitVersteck]{Kummst du mul kuckn?}

\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [NTG-context] viewer layers (optional content groups, OCG)
  2023-06-19 18:41 [NTG-context] viewer layers (optional content groups, OCG) Henning Hraban Ramm via ntg-context
@ 2023-06-22 16:07 ` Hans Hagen via ntg-context
  2023-06-23 18:21   ` Pablo Rodriguez via ntg-context
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen via ntg-context @ 2023-06-22 16:07 UTC (permalink / raw)
  To: Henning Hraban Ramm via ntg-context; +Cc: Hans Hagen

On 6/19/2023 8:41 PM, Henning Hraban Ramm via ntg-context wrote:
> Checking viewer layers:
> 
> * \setupviewerlayer doesn’t work; e.g. "state=stop" only works if I put 
> it in \defineviewerlayer
in next upload

-----------------------------------------------------------------
                                           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 / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [NTG-context] viewer layers (optional content groups, OCG)
  2023-06-22 16:07 ` Hans Hagen via ntg-context
@ 2023-06-23 18:21   ` Pablo Rodriguez via ntg-context
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2023-06-23 18:21 UTC (permalink / raw)
  To: Hans Hagen via ntg-context; +Cc: Pablo Rodriguez

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

On 6/22/23 18:07, Hans Hagen via ntg-context wrote:
> On 6/19/2023 8:41 PM, Henning Hraban Ramm via ntg-context wrote:
>> Checking viewer layers:
>>
>> * \setupviewerlayer doesn’t work; e.g. "state=stop" only works if I put
>> it in \defineviewerlayer
> in next upload

Hans,

since this is related to OCG, a minor improvement.

/Export (inside /Usage) is actually a dictionary with a single entry
(/ExportState) and values /ON and /OFF (from the PDF spec
https://raw.githubusercontent.com/adobe/dc-acrobat-sdk-docs/master/docs/standards/pdfstandards/pdf/PDF32000_2008.pdf#search=ExportState):

The attached patch fixes this issue.

Many thanks for your help,

Pablo

[-- Attachment #2: ocg-export.diff --]
[-- Type: text/x-patch, Size: 399 bytes --]

--- lpdf-ren.lmt	2023-06-23 20:08:17.096662826 +0200
+++ mkxl/lpdf-ren.lmt	2023-06-23 20:09:05.358959481 +0200
@@ -78,8 +78,8 @@
 }
 
 local pdf_export = {
-    [v_yes] = pdf_on,
-    [v_no]  = pdf_off,
+    [v_yes] = pdfdictionary { ExportState = pdf_on  },
+    [v_no]  = pdfdictionary { ExportState = pdf_on  },
 }
 
 -- We can have references to layers before they are places, for instance from

[-- Attachment #3: Type: text/plain, Size: 496 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-23 18:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-19 18:41 [NTG-context] viewer layers (optional content groups, OCG) Henning Hraban Ramm via ntg-context
2023-06-22 16:07 ` Hans Hagen via ntg-context
2023-06-23 18:21   ` Pablo Rodriguez via ntg-context

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).