3

When compiling(pdfLaTeX) with media9 v.0.48 (22 dec 2014) the ocg doesn't work if \includemedia command is present (no error). Everything is fine when using older media9(27 sept 2013)

\documentclass[]{article}

\usepackage{ocgx}
\usepackage[english]{babel} 
\usepackage{media9}% Pour le son
\begin{document}

\begin{ocg}{A}{Ai}{0}   % 0: invisible,   1: Visible
      Text to Show
\end{ocg}

\switchocg{Ai}{Click here to show text} 
\includemedia[addresource=./Figure/5sec45.mp3,activate=pageopen,  flashvars={source=./Figure/5sec45.mp3 &autoPlay=true}]{\fbox{Play}}{APlayer.swf}

\end{document}
  • 3
    Both media9 package and ocg-p package add a PDF catalog. Only one is authorized and used. – Paul Gaborit Jan 15 '15 at 0:10
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. This looks more like a "bug report" than a question. If you do have a question, please edit the post. If not, report this issue to the correct party. I suspect (hence "bug report" in quotes) this is not a bug, but a known limitation in compatibility between packages, because of Paul Gaborit's comment. – Paul Gessler Jan 15 '15 at 0:26
  • @PaulGaborit I could, perhaps, be willing to modify ocg-p to make it compatible with media9. Moreover, ocg-p needs to be overhauled, because its ps2pdf support is bugged. I once tried to contact the author, but he didn't respond. – AlexG Jan 15 '15 at 8:15
  • @AlexG The problem is more general: how to complete (or create) the PDF catalog? This feature should be treated by a specific package. – Paul Gaborit Jan 15 '15 at 9:32
  • @PaulGaborit I rewrote the ocgx commands. The code now works with the remaining engines and is media9 compatible. – AlexG Jan 20 '15 at 15:01
2

Packages ocgx (via package ocg-p) and media9 both make use of OCGs (PDF layers). Since both want to write to the global \OCProperties dictionary within the PDF Catalog, they cannot be used together (without further action).

Update:

The recent package fixocgx is supposed to remedy this; moreover, it extends ocgx functionality to the dvips -> ps2pdf, xelatex and dvipdfmx routes (though a recent Ghostscript (>=9.15) is required for ps2pdf to work).

enter image description here

\documentclass{article}

\usepackage{ocgx}
\usepackage{fixocgx}

\usepackage[english]{babel} 
\usepackage{media9}% Pour le son

\begin{document}

\begin{ocg}{A}{Ai}{0}
  \strut Text to Show
\end{ocg}

\switchocg{Ai}{\fbox{Click here to toggle text visibility}}

\includemedia[transparent,flashvars={source=http://www.openbsd.org/songs/song49.mp3&autoPlay=true}]{\fbox{\huge Play}}{APlayer.swf}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.